The default XSL:FO approach
Example 4 shows XSL templates that create a single page sequence. The output from this XSL is a set of hierarchically organized fo:blocks within the single page sequence. Notice the relationship of the <fo:page-sequence> element to the <xsl:apply-templates> element — one contained in the other.
These templates generate the output in Example 2, in which a single fo:page-sequence and fo:flow are wrapped around all the top-level section elements.
Example 4<xsl:template match="/book">
<fo:page-sequence>
<fo:flow>
<fo:block>
<xsl:apply-templates select="section"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
</xsl:template>
<xsl:template match="section">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="body">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
Next Page:
The XSL:FO solution
