【发布时间】:2018-12-30 22:33:35
【问题描述】:
我有一个场景,我需要使用 XSLT 在 pdf 中呈现 html。我在 xml 文件中有一些 html 内容,例如
<section>
<p><b><u>Heelo</u></b></p>
</section>
我需要在 pdf 中呈现这个。
<xsl:template match="b">
<fo:inline font-weight="bold">
<xsl:apply-templates select="*|text()" />
</fo:inline>
</xsl:template>
<xsl:template match="u">
<fo:inline text-decoration="underline">
<xsl:apply-templates select="*|text()" />
</fo:inline>
</xsl:template>
<xsl:template match="i">
<fo:inline font-style="italic">
<xsl:apply-templates select="*|text()" />
</fo:inline>
</xsl:template>
但是这个模板匹配不起作用。在java中创建xml时如何实现这一点或有什么方法可以替换 as >?
提前感谢您的帮助!!!
【问题讨论】:
-
你能使用 XSLT 3.0 吗?