当前位置: 首页 > 网络学院 > XML相关教程 > XSL-FO > XSL-FO 和 XSLT

XSL-FO
XSL-FO 介绍
XSL-FO 文档
XSL-FO 区域
XSL-FO 输出
XSL-FO 流程
XSL-FO 页面
XSL-FO 块状区域
XSL-FO 列表
XSL-FO 表格
XSL-FO 和 XSLT
XSL-FO 软件
XSL-FO 参考资料

XSL-FO 和 XSLT


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 705 ::
收藏到网摘: n/a

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.

评论 (0) All

登陆 | 还没注册?