Apache FOP and additional output formats

Here should go questions about transforming XML with XSLT and FOP.
amix
Posts: 81
Joined: Sat Aug 05, 2006 10:43 pm

Apache FOP and additional output formats

Post by amix » Sat Aug 14, 2010 12:39 am

Do you plan to add additional output formats to the XSLFO transformation scenario dialog? Currently there is PDF, TXT and PS. I would like to have an Area Tree also. Even RTF (though, they say it's incomplete) would be nice. This is all for testing while doing the stylesheet.
Andreas

Radu
Posts: 6569
Joined: Fri Jul 09, 2004 5:18 pm

Re: Apache FOP and additional output formats

Post by Radu » Mon Aug 16, 2010 9:42 am

Hi Andreas,

For now the "Method" combo box from the transformation scenario is limited to the three values you specified above. We will discuss if we can make this more flexible for a future version.
But you have a workaround:
In the Oxygen Preferences XML / XSLT-FO-XQuery / FO Processors define a new external FO processor with a custom name and the following command line:

Code: Select all

java -Xmx250m "-Dcom.oxygenxml.editor.home.url=${oxygenHome}" -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser "-Dlog4j.configuration=${oxygenHome}/tools/config/log4j.xml" -cp "${oxygenInstallDir}/classes/;${oxygenInstallDir}/lib/author.jar;${oxygenInstallDir}/lib/oxygen.jar;${oxygenInstallDir}/lib/oxygenEclipse.jar;${oxygenInstallDir}/lib/authorEclipse.jar;${oxygenInstallDir}/lib/xercesImpl.jar;${oxygenInstallDir}/lib/resolver.jar;${oxygenInstallDir}/lib/log4j.jar;${oxygenInstallDir}/lib/fop.jar;${oxygenInstallDir}/lib/avalon-framework-4.2.0.jar;${oxygenInstallDir}/lib/batik-all-1.7.jar;${oxygenInstallDir}/lib/commons-io-1.3.1.jar;${oxygenInstallDir}/lib/xmlgraphics-commons-1.4.jar;${oxygenInstallDir}/lib/commons-logging-1.0.4.jar;${oxygenInstallDir}/lib/saxon9ee.jar;${oxygenInstallDir}/lib/serializer.jar;${oxygenInstallDir}/lib/xml-apis-xpath.jar;${oxygenInstallDir}/lib/xml-apis-ext.jar;${oxygenInstallDir}/lib/jeuclid-core.jar;${oxygenInstallDir}/lib/jeuclid-fop.jar" org.apache.fop.cli.Main -fo ${fo} -at ${out}
The command line is almost identical to the one run by Oxygen but it hard codes the FO method to at which means area tree. Then save the result of the transformation as XML.
You can also create a new External FOP which outputs only RTF this way.

Then in the transformation scenario choose as a FO processor one of the newly created ones and run the transformation.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

amix
Posts: 81
Joined: Sat Aug 05, 2006 10:43 pm

Re: Apache FOP and additional output formats

Post by amix » Mon Aug 16, 2010 6:29 pm

This is great! Thank you very much!
Andreas

Post Reply