Convert XML to FO with fop-2.0-bin.zip

Q

How to convert my data in XML to XSL-FO format with fop-2.0-bin.zip? I have the XSLT file to define my data should be formatted.

✍: FYIcenter.com

A

If your data stored in XML format and you have an XSLT file that defines how data should be formatted, you can use the XSLT process provided in fop-2.0-bin.zip to convert the XML file to an XSL-FO file as shown below:

\fyicenter>cd \local\fop-2.0

\local\fop-2.0>java
java version "1.7.0_45"

\local\fop-2.0>java -cp .\lib\xalan-2.7.0.jar;.\lib\serializer-2.7.0.jar 
   org.apache.xalan.xslt.Process 
   -IN examples\embedding\xml\xml\projectteam.xml 
   -XSL examples\embedding\xml\xslt\projectteam2fo.xsl 
   -OUT \temp\projectteam.fo   

\local\fop-2.0>dir \temp\projectteam.fo
   2,178 projectteam.fo

Back to FAQ on FOP (Formatting Objects Processor).

2016-07-05, 781👍, 0💬