This section provides a simple XSL-FO (XSL Formatting Objects) document, hello.fo.
The FOP package also contains another XML tool called "xalan". It can be used to
transform an XML file based the transformation templates defined in an XSL file.
To run "xalan", create a batch file, xalan.bat, with the following command:
This is exactly what I expected. The output generated from the transformation
template contains the formatting objects and information from the source XML
file. Note that the format is not well maintained during the transformation.
The first line is too long, I have to truncate it.
So if you have some data organized in an XML file, you can write an XSL file
with transformation templates to re-organize the data. In the same XSL file,
you can also put some formatting objects to format the re-organized data
into a pintable format.
You can finish the transformation and formatting process in two steps:
1. Use "xalan" to transform the XML file with the XSL file into a FO file.
2. Use "fop" to format the FO file into a PDF file.