Convert XML to FO with FOP

Q

How to convert my data in XML to XSL-FO format with FOP? 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 to convert the XML file to an XSL-FO file as shown below:

fyicenter> cd \local\fop-2.2\fop

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

fyicenter> dir \temp\projectteam.fo
   2,176 projectteam.fo

 

Managing Fonts in FOP PDF Output

Call FOP with Debug Logging

FOP Commands and Examples

⇑⇑ FAQ for FOP (Formatting Object Processor)

2016-07-05, 2019👍, 0💬