Transforming a Document into Formatting Object Form

To transform ch14_01.xml into a document that uses formatting objects, which I'll call ch14_03.fo, all I have to do is apply the stylesheet ch14_02.xsl to ch14_01.xml. You can do that using the XSLT techniques we saw in the previous chapter. For example, you can use the ch13_05.class application like this (this assumes that ch13_05.class, ch14_01.xml, and ch14_02.xsl are all in the current directory):

%java ch13_05 ch14_01.xml ch14_02.xsl ch14_03.fo 

The document ch14_03.fo uses the XSL formatting objects to specify how the document should be formatted. Here's what ch14_03.po looks like:

Listing . ch14_03.po
 <?xml version="1.0" encoding="UTF-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> ...

Get Real World XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.