网络学院 w3pop社区 网络资源 IT新闻

w3pop.com :: 网络学院 :: 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


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-29 修改:2007-08-21 浏览:2141 :: ::

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">

W3pop
</fo:block>
<fo:block
text-indent="5mm"
font-family="verdana" font-size="12pt"
space-before="5mm" space-after="5mm">

At w3pop.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:
上述代码将输出下面的结果:


W3pop

At w3pop.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>
W3pop
</header>
<paragraph>
At W3pop.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:
结果仍然相同:


W3pop

At W3pop.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