我使用XSLT 1.0,我有一个XML,看起来像这样
<item name="note"><value><p>Add the &lt;bean&gt; tag pased below to the &lt;beans&gt; element in this file .... </value></item>
我想在HTML中显示它
Add the <bean> tag passed below to the <beans> element in this file.
请注意,当我使用disable-output-escaping = yes时,<p>将转换为段落标记 .
这就是我在xslt中的含义
<xsl:template match="item[@name='note']">
<xsl:value-of select="value" disable-output-escaping="yes" />
</xsl:template>
使用这个xslt它会忽略bean和beans xml,它不会显示在页面中 . 我如何确保以我想要的方式显示它?
1 回答
问题是你的一些实体已经"double escaped" .
&lt;bean&gt;
应为<bean>