【发布时间】:2014-07-09 20:26:44
【问题描述】:
我有一个这样的 XML 文档:
<bibliography>
<element1>
<text>
Some text and <italic>italic Text</italic> and <bold>bold text</bold>
</text>
</element1>
<element2>
<text>
Some text and <italic>italic Text</italic> and <bold>bold text</bold>
</text>
</element2>
</bibliography>
此 XSL 有效,但无法格式化 <italic> 或 <bold> 标记。
<xsl:template match="/">
<html>
<head>
<title>Bibliographie</title>
<style type="text/css">
.entry {
font-family: Georgia
}
</style>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="/bibliography/*">
<p>
<div class="entry{@type}">
[<xsl:number count="*"/>]
<xsl:apply-templates/>
</div>
</p>
</xsl:template>
我必须添加什么才能让它格式化 <italic> 和 <bold> 标记以适合 HTML?
我尝试使用 XSL-FO,但似乎无法将对象导出为 HTML,只能导出为 PDF。
【问题讨论】: