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 Rick Roen <Ri...@LakeValleySeed.com> on 2006/05/31 22:17:55 UTC
Saxon 8 with FOP 0.92b
I am using Saxon 8 to do the xslt transformation from xml -> xsl -> pdf in
FOP 0.92b.
I have Saxon8.jar listed in the java\lib\endorsed which works find with my
DOS batch file.
I am getting ready to deploy the application and would rather not try to add
something to the clients java setup, but rather just tell FOP to use SAXON 8
for its transformation.
I am using the FOP.bat file that was downloaded with the install that has
this type of format:
set LOCALCLASSPATH=%LOCAL_FOP_HOME%build\fop.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LOCAL_FOP_HOME%build\fop-sandbox.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LOCAL_FOP_HOME%build\fop-hyph.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis-1.3.02.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl-2.7.1.jar
rem set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.7.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;C:PROGRA~1\SAXON\Saxon8.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;C:PROGRA~1\SAXON\Saxon8-dom.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\serializer-2.7.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\batik-all-1.6.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xmlgraphics-commons-1.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\avalon-framework-4.2.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-io-1.1.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-logging-1.0.4.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jimi-1.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_core.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_codec.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\fop-hyph.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%FOP_HYPHENATION_PATH%
I took out the Xalan-2.7.0.jar and put in references to Saxon but I get an
error that starts with:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/xml/serial
izer/OutputPropertiesFactory at
org.apache.xalan.templates.OutputProperties.<init>(OutputProperties.java:81)
What is the proper way to tell FOP to use saxon, or do I have to do a two
step process of creating the fo file and then using it to get the final pdf?
Thanks,
Rick
RE: Saxon 8 with FOP 0.92b
Posted by Rick Roen <Ri...@LakeValleySeed.com>.
OK, got it working now.
Here are the changes to the batch file in case it can help someone else:
rem set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.7.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\Saxon8.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\Saxon8-dom.jar
Take out xalan-2.7.0.jar, add Saxon8.jar and Saxon8-com.jar (which I added
to the FOP\lib, but I think they can be anywhere)
Command line:
java %LOGCHOICE% %LOGLEVEL% \
-Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl
-cp "%LOCALCLASSPATH%" \
org.apache.fop.cli.Main \
-xml file.xml \
-xsl file.xsl \
-pdf file.pdf
Thanks for the suggestion Chris.
FYI - I am using java 1.5.0_06.
Rick
-----Original Message-----
From: Chris Bowditch [mailto:bowditch_chris@hotmail.com]
Sent: Thursday, June 01, 2006 4:12 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Saxon 8 with FOP 0.92b
Chris Bowditch wrote:
Uh... what I wrote is only half the picture. If Saxon is in the
classpath (not lib\endorsed), then setting TransformerFactory= should be
enough to ensure Saxon is used by the JAXP API
Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Saxon 8 with FOP 0.92b
Posted by Chris Bowditch <bo...@hotmail.com>.
Chris Bowditch wrote:
> Rick Roen wrote:
>
>> Andreas,
>>
>> I did add this line to my batch file, which does make it work, however I
>> still have to have the saxon8.jar and saxon8-dom.jar in my
>> java\lib\endorsed.
>>
>> In fact my batch file works the same with or without the additional
>> TransformerFactory=...
>>
>> I believe that FOP will automatically use saxon when it is found in the
>> endorsed folder (at least that's what I am doing now and it does work).
>>
>> Thanks for the help, I guess I will just have to make sure the clients
>> have
>> the two jar files in the endorsed folder.
>
>
> What version of Java are you using? 1.4 comes and above comes with Xalan
> built into the JDK and the only way to override it is to place JARs into
> the lib endorsed folder.
Uh... what I wrote is only half the picture. If Saxon is in the
classpath (not lib\endorsed), then setting TransformerFactory= should be
enough to ensure Saxon is used by the JAXP API
Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Saxon 8 with FOP 0.92b
Posted by Chris Bowditch <bo...@hotmail.com>.
Rick Roen wrote:
> Andreas,
>
> I did add this line to my batch file, which does make it work, however I
> still have to have the saxon8.jar and saxon8-dom.jar in my
> java\lib\endorsed.
>
> In fact my batch file works the same with or without the additional
> TransformerFactory=...
>
> I believe that FOP will automatically use saxon when it is found in the
> endorsed folder (at least that's what I am doing now and it does work).
>
> Thanks for the help, I guess I will just have to make sure the clients have
> the two jar files in the endorsed folder.
What version of Java are you using? 1.4 comes and above comes with Xalan
built into the JDK and the only way to override it is to place JARs into
the lib endorsed folder.
<snip/>
Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
RE: Saxon 8 with FOP 0.92b
Posted by Rick Roen <Ri...@LakeValleySeed.com>.
Andreas,
I did add this line to my batch file, which does make it work, however I
still have to have the saxon8.jar and saxon8-dom.jar in my
java\lib\endorsed.
In fact my batch file works the same with or without the additional
TransformerFactory=...
I believe that FOP will automatically use saxon when it is found in the
endorsed folder (at least that's what I am doing now and it does work).
Thanks for the help, I guess I will just have to make sure the clients have
the two jar files in the endorsed folder.
Rick
>>>>>>
If I recall correctly, the easiest way to achieve the effect you're
after is by modifying fop.bat to force the relevant JAXP system
property through the java command-line, e.g.:
java -Djavax.xml.transform.TransformerFactory=...
make this point to Saxon's TransformerFactory implementation, and you
should be good to go.
HTH!
Cheers,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Saxon 8 with FOP 0.92b
Posted by Andreas L Delmelle <a_...@pandora.be>.
On May 31, 2006, at 22:17, Rick Roen wrote:
Hi,
> I am using Saxon 8 to do the xslt transformation from xml -> xsl ->
> pdf in FOP 0.92b.
>
> I have Saxon8.jar listed in the java\lib\endorsed which works find
> with my DOS batch file.
>
> I am getting ready to deploy the application and would rather not
> try to add something to the clients java setup, but rather just
> tell FOP to use SAXON 8 for its transformation.
<snip />
> What is the proper way to tell FOP to use saxon, or do I have to do
> a two step process of creating the fo file and then using it to get
> the final pdf?
If I recall correctly, the easiest way to achieve the effect you're
after is by modifying fop.bat to force the relevant JAXP system
property through the java command-line, e.g.:
java -Djavax.xml.transform.TransformerFactory=...
make this point to Saxon's TransformerFactory implementation, and you
should be good to go.
HTH!
Cheers,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org