<xsl:value-of select="TextBlock" disable-output-escaping="yes"/>
结果:
<h1>This is a header.</h1>
<p>This is a paragraph.</p>
Firefox 有一个对应的 bug:https ://bugzilla.mozilla.org/show_bug.cgi?id=98168 ,其中包含很多评论,读起来很有趣。
我现在正在寻找解决方法。
编辑
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="disable-output-escaping.xsl"/>
<!-- https://bug98168.bugzilla.mozilla.org/attachment.cgi?id=434081 -->
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
<xsl:template match="/TextBlock">
<xsl:copy>
<xsl:call-template name="disable-output-escaping"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
通过 Firebug 检查时,结果看起来是正确的:
<textblock>
<h1>This is a header.</h1>
<p>This is a paragraph.</p>
</textblock>