XSL-FO and XSLT can help each other.
XSL-FO 和 XSLT 可以进行功能互补。
Remember this Example?
还记得下面这个案例吗?
<fo:block font-size="14pt" font-family="verdana" color="red" space-before="5mm" space-after="5mm">
ruanchen </fo:block> <fo:block text-indent="5mm" font-family="verdana" font-size="12pt" space-before="5mm" space-after="5mm">
At ruanchen.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> |
Result:
上述代码将输出下面的结果:
ruanchen At ruanchen.com you will find all the Web-building tutorials you need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP. |
The example above is from the chapter about XSL-FO Blocks.
上述案例来自于 “XSL-FO 块状区域” 的相关章节。
With a Little Help from XSLT
从XSLT中得到一些帮助
Remove the XSL-FO information from the document:
从文档中删除XSL-FO信息的方法:
<header> ruanchen </header> <paragraph> At ruanchen.com you will find all the Web-building tutorials you need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP. </paragraph> |
Add an XSLT transformation:
添加一条 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> |
And the result will be the same:
结果仍然相同:
ruanchen At ruanchen.com you will find all the Web-building tutorials you need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP. |