XSL-FO XSLT
XSL-FO 與 XSLT 可彼此互助。
還記得這個實例嗎?
<fo:block
font-size="14pt" font-family="verdana" color="red"
space-before="5mm" space-after="5mm">
PHP.CN
</ fo:block>
<fo:block text-indent="5mm" font-family="verdana" font-size="12pt">
At W3CSchool you will find all the Web-building tutorials you
need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP .
</fo:block>
space-before="5mm" space-after="5mm">
PHP.CN
</ fo:block>
<fo:block text-indent="5mm" font-family="verdana" font-size="12pt">
At W3CSchool you will find all the Web-building tutorials you
need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP .
</fo:block>
結果:
PHP.CN ##At php.cn you will find all the Web-building tutorials you need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP. |
來自XSLT 的幫助從文件移除XSL-FO 資訊:
<header>PHP.CN</header>
<paragraph>At php.cn you will find all the Web-building tutorials you
need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP.
</paragraph>
新增XSLT 轉換:<paragraph>At php.cn you will find all the Web-building tutorials you
need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP.
</paragraph>
<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">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
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">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
#PHP.CNAt php.cn you will find all the Web-building tutorials you need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP. |