XPath version
What version of XPath is used in FOP 0.93 when parsing through an XSLT-FO file? Is there a way to control the XPath version being used? I'm trying to use: xsl:if test=upper-case( ../NAME ) = quot;SITE NAMEquot; But I get the error: SystemId Unknown; Line #27; Column #73; Could not find function: upper-case SystemId Unknown; Line #27; Column #73; function token not found. (Location of error unknown)java.lang.NullPointerException Mar 6, 2007 1:18:31 PM org.apache.fop.cli.Main startFOP SEVERE: Exception java.lang.NullPointerException at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115) at org.apache.fop.cli.Main.startFOP(Main.java:160) at org.apache.fop.cli.Main.main(Main.java:191) I'm using FOP 0.93, and am converting XML to PDF through XSLT: .\fop-0.93\Fop.bat -xml upper-case_test.xml -xsl upper-case_test.xslt -pdf upper-case_test.pdf Thanks! Jeff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XPath version
Jeff Vannest wrote: What version of XPath is used in FOP 0.93 when parsing through an XSLT-FO file? Is there a way to control the XPath version being used? I'm trying to use: xsl:if test=upper-case( ../NAME ) = quot;SITE NAMEquot; I don't know whether you can control what XSLT/XPath processor is being used, but if you want to control the version, you can do so in the XSLT header. There is no way to control an XPath version, as a simple rule of the standard states that XSLT 2.0 is always chained with XPath 2.0 and XSLT 1.0 with XPath 1.0 (not vice versa, XPath can also be used stand alone). Changing the version won't have any effect, because FOP uses, if you specify an XSLT file, an XSLT 1.0 processor. XSLT-FO does not exist. I think you meant an XSLT stylesheet that, with some input file, will result in an XSL-FO file, which in turn will be processed by FOP. If you want to use upper-case() and don't want to use the obvious and ugly translate() hack you need for XSLT 1.0, you should consider XSLT 2. Processors that support XSLT 2.0 (and as a result must process XPath 2.0) are Saxon 8 (.Net and Java), Gestalt (standalone and Eiffel), AltovaXML (only standalone, free, no source). Only the first is by most people considered both stable, fast and compliant. Gestalt is getting closer, AltovaXML still has a long way to go, but does claim compliancy. If you go that path, I suggest you split your process in two steps. This can be done from a windows batch file, or any other means of course. First step: process your input XML with XSLT, second step: process the resulting XSL-FO(s). With time, you will probably find this way more convenient and more versatile (I did). Cheers, -- Abel Braaksma - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XPath version
On Mar 6, 2007, at 19:51, Abel Braaksma wrote: Hi, Jeff Vannest wrote: What version of XPath is used in FOP 0.93 when parsing through an XSLT-FO file? Is there a way to control the XPath version being used? I'm trying to use: xsl:if test=upper-case( ../NAME ) = quot;SITE NAMEquot; snip / In addition to Abel's fine explanation, note that to make FOP work with Saxon, you can also do this in one of the following ways: Add saxon8.jar to your classpath, and a) modify (or create) /$JAVA_HOME$/lib/jaxp.properties add: javax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryIm pl b) modify fop.bat, and change the final line to: %JAVACMD% - Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryI mpl ... a) will make any Java application that uses the JAXP API use Saxon. b) will do the same, but only when you run FOP. HTH! Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XPath version
On Mar 6, 2007, at 20:54, Jeff Vannest wrote: If you go that path, I suggest you split your process in two steps. Okay, I understand. I assumed that XPath 1.0 came along for the ride with XSLT 1.0, but I wanted to make certain. If you go that path, I suggest you split your process in two steps. I'm working with an embedded application, so Saxon sounds like the way to go. Unfortunately, I just don't have time for that additional work in my development timeline. Well, in that case, see my mail previous mail. Either change the TransformerFactory implementation for *all* Java applications using JAXP (including FOP), or IIC, it should also work if you set the related Java System property programmatically, before calling upon the TransformerFactory in the embedding application: System.setProperty(javax.xml.transform.TransformerFactory, net.sf.saxon.TransformerFactoryImpl); Cheers, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]