XSL-FO 與 XSLT
XSL-FO 與 XSLT 可彼此互助。
還記得這個例子嗎?
<fo:block font-size="14pt" font-family="verdana" color="red" space-before="5mm" space-after="5mm"> W3School </fo:block> <fo:block text-indent="5mm" font-family="verdana" font-size="12pt" space-before="5mm" space-after="5mm"> At CodeW3C.com you will find all the Web-building tutorials you need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP. </fo:block>
結果:

此例來自有關 XSL-FO 塊區域的那一節。
來自 XSLT 的幫助
從文檔移除 XSL-FO 信息:
<header> W3School </header> <paragraph> At CodeW3C.com you will find all the Web-building tutorials you need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP. </paragraph>
添加 XSLT 轉換:
<xsl:template match="header"> <fo:block font-size="14pt" font-family="verdana" color="red" space-before="5mm" space-after="5mm"> <xsl:apply-templates/> </fo:block> </xsl:template> <xsl:template match="paragraph"> <fo:block text-indent="5mm" font-family="verdana" font-size="12pt" space-before="5mm" space-after="5mm"> <xsl:apply-templates/> </fo:block> </xsl:template>
產生的結果是相同的:
