XSL-FO 与 XSLT 可彼此互助。
还记得这个例子吗?
- <fo:block
- font-size="14pt" font-family="verdana" color="red"
- space-before="5mm" space-after="5mm">
- W3xue
- </fo:block>
- <fo:block
- text-indent="5mm"
- font-family="verdana" font-size="12pt"
- space-before="5mm" space-after="5mm">
- At W3xue you will find all the Web-building tutorials you
- need, from basic HTML and HTML5 to advanced XML, PHP,ASP.net, Python and
- Multimedia.
- </fo:block>
结果:

此例来自有关 XSL-FO 块区域的那一节。
来自 XSLT 的帮助
从文档移除 XSL-FO 信息:
- <header>
- W3xue
- </header>
- <paragraph>
- At W3xue you will find all the Web-building tutorials you
- need, from basic HTML and HTML5 to advanced XML, PHP,ASP.net, Python
- and Multimedia.
- </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>
产生的结果是相同的:

转载本站内容时,请务必注明来自W3xue,违者必究。