You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Jeff Vannest <Je...@jandrconsult.com> on 2007/03/06 19:36:53 UTC
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 ) = "SITE NAME"">
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: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: XPath version
Posted by Andreas L Delmelle <a_...@pandora.be>.
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 ) = "SITE NAME"">
>>
<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: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: XPath version
Posted by Abel Braaksma <ab...@xs4all.nl>.
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 ) = "SITE NAME"">
>
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: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org