Loading ...
Sorry, an error occurred while loading the content.

Re: [XSL-FO] using Saxon with FOP (instead of xalan)

Expand Messages
  • Dave Pawson
    ... http://www.saxonica.com/documentation/using-xsl/commandline.html May help, and yes your approach is right. HTH -- Regards, Dave Pawson XSLT + Docbook FAQ
    Message 1 of 7 , Jun 27, 2005
    • 0 Attachment
      On Mon, 2005-06-27 at 01:41 +0000, arianhojat2000 wrote:
      > Is there anyway to use Saxon with FOP?
      > I assume the easist thing to do is to in xalan.bat, change
      >
      > java -cp %LOCALCLASSPATH% org.apache.xalan.xslt.Process %1 %2 %3 %4 %5
      > %6 %7 %8
      >
      > ...to...
      >
      > java net.sf.saxon.Transform (not sure what all the above variables are)

      http://www.saxonica.com/documentation/using-xsl/commandline.html

      May help, and yes your approach is right.

      HTH


      --
      Regards,

      Dave Pawson
      XSLT + Docbook FAQ
      http://www.dpawson.co.uk
    • J.Pietschmann
      ... This is wrong. The xalan.bat is provided as a convenience and because it is easier to tell run xalan.bat and post the relevant parts of the result rather
      Message 2 of 7 , Jun 27, 2005
      • 0 Attachment
        arianhojat2000 wrote:
        > Is there anyway to use Saxon with FOP?
        > I assume the easist thing to do is to in xalan.bat, change
        >
        > java -cp %LOCALCLASSPATH% org.apache.xalan.xslt.Process %1 %2 %3 %4 %5
        > %6 %7 %8
        >
        > ...to...
        >
        > java net.sf.saxon.Transform (not sure what all the above variables are)
        >
        > (which i assume xalan.bat gets called to transform the xml doc with
        > the xsl doc you provide to FOP).

        This is wrong. The xalan.bat is provided as a convenience and
        because it is easier to tell "run xalan.bat and post the relevant
        parts of the result rather than XML+XSLT snippets". The file is
        not called elswhere.
        In order to use Saxon, you'll can set the
        javax.xml.transform.TransformerFactory
        system property to Saxon's factory class. See the javadoc for
        javax.xml.transform.TransformerFactory for other possiblities and
        more details.

        J.Pietschmann
      • pablo_yamamoto
        hi, if you use Ant for your tasks, everything is easy. Following the documentation and examples I did it this way: ...
        Message 3 of 7 , Jun 27, 2005
        • 0 Attachment
          hi,

          if you use Ant for your tasks, everything is easy. Following the
          documentation and examples I did it this way:

          ...
          <property name="antHome" value="c:\ant"/>
          <property name="jar.dir" value="d:\jar"/>
          <property name="saxon8Jar" value="${jar.dir}\saxon8.jar"/>
          <property name="processor" value="trax"/>
          ...
          ...

          <target name="makeFO" depends="init" description="Generates FO
          files">
          <delete dir="${foDir}"/>
          <mkdir dir="${foDir}"/>
          <xslt basedir="${dirXMLfiles}"
          destdir="${foDir}"
          extension=".fo"
          style="${xslCv-pdf}"
          classpath="${saxon8jar};${antHome}/lib/ant-trax.jar"
          processor="${processor}"/>

          ....

          Maybe it can be useful to you.

          Regards,

          Pablo

          --- In XSL-FO@yahoogroups.com, "arianhojat2000" <arianhojat2000@y...>
          wrote:
          > Is there anyway to use Saxon with FOP?
          > I assume the easist thing to do is to in xalan.bat, change
          >
          > java -cp %LOCALCLASSPATH% org.apache.xalan.xslt.Process %1 %2 %3 %4
          %5
          > %6 %7 %8
          >
          > ...to...
          >
          > java net.sf.saxon.Transform (not sure what all the above variables
          are)
          >
          > (which i assume xalan.bat gets called to transform the xml doc with
          > the xsl doc you provide to FOP).
          >
          > Thanks for any info,
          > Arian
        • pablo_yamamoto
          Oh, I forgot the FOP part in Ant, here it is :P ...
          Message 4 of 7 , Jun 27, 2005
          • 0 Attachment
            Oh, I forgot the FOP part in Ant, here it is :P
            ...
            <taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop">
            <classpath>
            <pathelement location="${jar.dir}\fop.jar"/>
            <pathelement location="${jar.dir}\avalon.jar"/>
            <pathelement location="${jar.dir}\batik.jar"/>
            </classpath>
            </taskdef>
            ...
            ...

            <target name="makePDF" depends="makeFO" description="Generates PDF
            files">
            ...
            ...

            <fop format="application/pdf" outdir="${pdfDir}"
            messagelevel="debug">
            <fileset dir="${foDir}">
            <include name="*.fo"/>
            </fileset>
            </fop>

            ..
            ..
            </target>

            Regards,

            Pablo

            --- In XSL-FO@yahoogroups.com, "pablo_yamamoto" <Ekeko@G...> wrote:
            > hi,
            >
            > if you use Ant for your tasks, everything is easy. Following the
            > documentation and examples I did it this way:
            >
            > ...
            > <property name="antHome" value="c:\ant"/>
            > <property name="jar.dir" value="d:\jar"/>
            > <property name="saxon8Jar" value="${jar.dir}\saxon8.jar"/>
            > <property name="processor" value="trax"/>
            > ...
            > ...
            >
            > <target name="makeFO" depends="init" description="Generates FO
            > files">
            > <delete dir="${foDir}"/>
            > <mkdir dir="${foDir}"/>
            > <xslt basedir="${dirXMLfiles}"
            > destdir="${foDir}"
            > extension=".fo"
            > style="${xslCv-pdf}"
            > classpath="${saxon8jar};${antHome}/lib/ant-trax.jar"
            > processor="${processor}"/>
            >
            > ....
            >
            > Maybe it can be useful to you.
            >
            > Regards,
            >
            > Pablo
            >
            > --- In XSL-FO@yahoogroups.com, "arianhojat2000"
            <arianhojat2000@y...>
            > wrote:
            > > Is there anyway to use Saxon with FOP?
            > > I assume the easist thing to do is to in xalan.bat, change
            > >
            > > java -cp %LOCALCLASSPATH% org.apache.xalan.xslt.Process %1 %2 %3
            %4
            > %5
            > > %6 %7 %8
            > >
            > > ...to...
            > >
            > > java net.sf.saxon.Transform (not sure what all the above
            variables
            > are)
            > >
            > > (which i assume xalan.bat gets called to transform the xml doc
            with
            > > the xsl doc you provide to FOP).
            > >
            > > Thanks for any info,
            > > Arian
          • arianhojat2000
            hmmm I think I would like to use the system property method the most. I use this rule I found in javadoc... The class named in the META-
            Message 5 of 7 , Jun 28, 2005
            • 0 Attachment
              hmmm I think I would like to use the system property method the most.

              I use this rule I found in javadoc...
              'The class named in the META-
              INF/services/javax.xml.transform.TransformerFactory file in the JAR
              archives available to the runtime.'

              so I create the folders/file and put it in fop.jar and use the class
              I think I need, net.sf.saxon.TransformerFactoryImpl...

              but I get this error running FOP when it tries to find Saxon:

              [INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
              Exception in thread "main"
              javax.xml.transform.TransformerFactoryConfigurationError: Provider
              net.sf.saxon.TransformerFactoryImpl not found
              at javax.xml.transform.TransformerFactory.newInstance(Unknown
              Source)
              at org.apache.fop.apps.TraxInputHandler.initTransformer
              (TraxInputHandler.java:105)
              at org.apache.fop.apps.TraxInputHandler.<init>
              (TraxInputHandler.java:84)
              at org.apache.fop.apps.XSLTInputHandler.<init>
              (XSLTInputHandler.java:71)
              at org.apache.fop.apps.CommandLineOptions.getInputHandler
              (CommandLineOptions.java:479)
              at org.apache.fop.apps.CommandLineStarter.<init>
              (CommandLineStarter.java:78)
              at org.apache.fop.apps.CommandLineOptions.getStarter
              (CommandLineOptions.java:522)
              at org.apache.fop.apps.Fop.main(Fop.java:61)

              saxon8.jar is in my CLASSPATH, so not sure why it errors.



              Thanks if someone has an idea.





              --- In XSL-FO@yahoogroups.com, "J.Pietschmann" <j3322ptm@y...> wrote:
              > arianhojat2000 wrote:
              > > Is there anyway to use Saxon with FOP?
              > > I assume the easist thing to do is to in xalan.bat, change
              > >
              > > java -cp %LOCALCLASSPATH% org.apache.xalan.xslt.Process %1 %2 %3 %
              4 %5
              > > %6 %7 %8
              > >
              > > ...to...
              > >
              > > java net.sf.saxon.Transform (not sure what all the above
              variables are)
              > >
              > > (which i assume xalan.bat gets called to transform the xml doc
              with
              > > the xsl doc you provide to FOP).
              >
              > This is wrong. The xalan.bat is provided as a convenience and
              > because it is easier to tell "run xalan.bat and post the relevant
              > parts of the result rather than XML+XSLT snippets". The file is
              > not called elswhere.
              > In order to use Saxon, you'll can set the
              > javax.xml.transform.TransformerFactory
              > system property to Saxon's factory class. See the javadoc for
              > javax.xml.transform.TransformerFactory for other possiblities and
              > more details.
              >
              > J.Pietschmann
            • J.Pietschmann
              ... Better look into the Saxon jar whether there is actually a net.sf.saxon.TransformerFactoryImpl there. Also, double check the classpath and whether it is
              Message 6 of 7 , Jun 29, 2005
              • 0 Attachment
                arianhojat2000 wrote:
                > so I create the folders/file and put it in fop.jar and use the class
                > I think I need, net.sf.saxon.TransformerFactoryImpl...

                Better look into the Saxon jar whether there is actually a
                net.sf.saxon.TransformerFactoryImpl there. Also, double check the
                classpath and whether it is picked up for processing.

                J.Pietschmann
              Your message has been successfully submitted and would be delivered to recipients shortly.