O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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"> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required