Formatting an XML Document

To format planets.xml into planets.pdf, we can use the XSL-FO formatting objects that are introduced in Chapter 12. For example, here’s how we might display the name of the first planet, Mercury, using XSL-FO formatting objects such as flow and block:

<fo:page-sequence master-name="page"> 
    <fo:flow flow-name="xsl-region-body"> 
<fo:block font-family="sans-serif" line-height="48pt" 
            font-size="36pt" font-weight="bold"> 
            Mercury 
        </fo:block> 
        . 
        . 
        . 

However, writing an entire document using the XSL formatting objects is not an easy task for any but short documents. W3C foresaw that difficulty, and that’s one of the main reasons they introduced the transformation language, XSLT. In particular, you can write a stylesheet and ...

Get Inside XSLT 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.