opposite method to disable output escaping in xslt [duplicate]

会有一股神秘感。 提交于 2019-12-11 09:13:10

问题


Possible Duplicate:
XSLT: How to convert XML Node to String

Input:

<text> aabbabab  </text>

output:

&lt;text&gt; aabbabab &lt;/text&gt;

This is the opposite to Disable output escaping.

How can we achieve this in xslt.

Can some one help on this.

Thanks


回答1:


See this answer.

In summary, the shortest solution uses a tiny extension function.




回答2:


If you can use Saxon extensions, try

<xsl:value-of select="saxon:serialize(text)"/>

If not, there are various posts that tell you how to write your own serialize() function in XSLT.



来源:https://stackoverflow.com/questions/11733618/opposite-method-to-disable-output-escaping-in-xslt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!