[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Advice on Java DocBook DOMSource() to PDF
Thanks, Bob. Your analysis has lead me to find this bug description: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4459167 Just for anyone following or searching on this thread, I tried the following in my URIResolver: URL myURL = this.getClass().getResource("/xsl/xhtml/"); streamSource.setSystemId(myURL.toString()); But, I got "(Access is denied)" errors. -- Don ----- Original Message ----- From: "Bob Stayton" <bobs@sagehill.net> To: "Don Adams" <dga@sgi.com>; <docbook-apps@lists.oasis-open.org> Sent: Friday, September 08, 2006 4:49 PM Subject: Re: [docbook-apps] Advice on Java DocBook DOMSource() to PDF > I think what is happening is your custom URIResolver is not being applied > to the XSLT document() function that is used in some places. In this > instance, in common/l10n.xsl you will find: > > <xsl:param name="l10n.xml" select="document('../common/l10n.xml')"/> > > This loads the locale text as XML content into the stylesheet parameter > named 'l10n.xml' (it just looks like a filename, but it is actually a > parameter name). Once it is loaded into the parameter, it can be queried > using XPath in test and select attributes. But I can't tell you how to > handle the document() function in your environment. > > Bob Stayton > Sagehill Enterprises > DocBook Consulting > bobs@sagehill.net > > > ----- Original Message ----- > From: "Don Adams" <dga@sgi.com> > To: "Bob Stayton" <bobs@sagehill.net>; <docbook-apps@lists.oasis-open.org> > Sent: Friday, September 08, 2006 2:10 PM > Subject: Re: [docbook-apps] Advice on Java DocBook DOMSource() to PDF > > > > > > Well, this is not an easy question to answer > > and is what I think may be the cause of the > > problem. The stylesheets are packaged as > > part of a WAR file (just like a JAR file). > > Because of this, in order for the > > <xsl:include href=""/> elements to work, > > I had to write a custom URIResolver in > > Java that basically said any references > > put in the href="" attribute actually > > map to C:\JBoss\jboss-4.0.\...xsl\xhtml\ > > > > So, this fixed the problem that I was > > having with the Java Transformer Class and > > not finding all of the *.xsl files for the > > docbook-xsl. So, to answer your original question, > > yes, all of the files are where they are supposed > > to be and the Java Transformer Class has > > been interacting with them. > > > > What I think may be happening is that the > > Java Transformer Class can't figure out how > > to handle this line in the common/l10n.xsl file: > > > > <xsl:when test="$l10n.xml/l:i18n/l:l10n[@language=$adjusted.language]"> > > > > I don't know enough about <xsl:choose> and > > the XPath statement used to know what's going > > on here. > > > > -- > > Don > > > > > > ----- Original Message ----- > > From: "Bob Stayton" <bobs@sagehill.net> > > To: "Don Adams" <dga@sgi.com>; <docbook-apps@lists.oasis-open.org> > > Sent: Friday, September 08, 2006 3:37 PM > > Subject: Re: [docbook-apps] Advice on Java DocBook DOMSource() to PDF > > > > > >> Are the DocBook XSL stylesheets installed in this directory? > >> > >> C:\Jboss\jboss-4.0.\ > >> > >> Because that is the path the error message indicates that it is trying > >> access: > >> > >> Cannot load requested doc: C:\Jboss\jboss-4.0.\bin\..\common\l10n.xml > >> > >> If they are not installed there, then something is going wrong with the > >> resolution of relative paths in the stylesheet or the servlet. > >> > >> Bob Stayton > >> Sagehill Enterprises > >> DocBook Consulting > >> bobs@sagehill.net > >> > >> > >> ----- Original Message ----- > >> From: "Don Adams" <dga@sgi.com> > >> To: "Don Adams" <dga@sgi.com>; <docbook-apps@lists.oasis-open.org> > >> Sent: Friday, September 08, 2006 1:28 PM > >> Subject: Re: [docbook-apps] Advice on Java DocBook DOMSource() to PDF > >> > >> > >> > > >> > The section titled "Adding XSL transformation (XSLT)" > >> > on this web page is exactly what I'm trying to do: > >> > > >> > http://xmlgraphics.apache.org/fop/0.20.5/servlets.html > >> > > >> > However, I get the errors listed below. I made > >> > it through the "write your own URIResolver" > >> > problem, but I haven't been able to get past > >> > the "No localization exists" errors below. > >> > > >> > -- > >> > Don > >> > > >> > > >> > > >> > ----- Original Message ----- > >> > From: "Don Adams" <dga@sgi.com> > >> > To: <docbook-apps@lists.oasis-open.org> > >> > Sent: Friday, September 08, 2006 2:55 PM > >> > Subject: [docbook-apps] Advice on Java DocBook DOMSource() to PDF > >> > > >> > > >> >> > >> >> I wrote a Java web application that is packaged in a WAR > >> >> file and runs on a JBoss server. The Java application > >> >> creates a valid, DocBook DOMSource(). I can transform this > >> >> DOMSource() into an XML file and manually run xsltproc > >> >> using the docbook-xsl-1.64.1 stylesheets. Then I manually run > >> >> fop-0.20.5 to generate the PDF I want from it. > >> >> > >> >> But, what I really want to do is to automatically generate PDF > >> >> from the DocBook DOMSource() in my Java web application so that > >> >> users can directly view a PDF file that is generated from a > >> >> database query. > >> >> > >> >> Does anyone have any advice on the best method to do this? > >> >> > >> >> > >> >> As a first step, I tried to use the > >> >> Transformer.transform(Source, Result) > >> >> XSL transformer in Java with the docbook-xsl-1.64.1 > >> >> stylesheets, but I get these errors for xhtml/docbook.xsl: > >> >> > >> >> 11:22:37,434 INFO [STDOUT] SystemId Unknown; Line #85; Column #15; > >> >> Can > >> > not > >> >> load requested doc: C:\Jboss\jboss-4.0.\bin\..\common\l10n.xml > >> >> 11:22:37,434 INFO [STDOUT] SystemId Unknown; Line #95; Column #20; > >> >> No > >> >> localization exists for "en" or "". Using default "en". > >> >> 11:22:37,434 INFO [STDOUT] Unknown error in XPath. > >> >> > >> >> > >> >> Now I'm stuck and am wondering if this is the > >> >> right path to go down for what I'm trying to do. > >> >> Maybe the docbook-xsl stylesheets aren't designed > >> >> to be usable in a WAR or JAR file and transformed > >> >> using the Java Transformer class? > >> >> > >> >> Thanks, > >> >> Don Adams > >> >> > >> >> > >> >> --------------------------------------------------------------------- > >> >> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org > >> >> For additional commands, e-mail: > >> >> docbook-apps-help@lists.oasis-open.org > >> > > >> > > >> > --------------------------------------------------------------------- > >> > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org > >> > For additional commands, e-mail: > >> > docbook-apps-help@lists.oasis-open.org > >> > > >> > > >> > > >> > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org > >> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org > > > > > > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]