1

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

Community
  • 1
  • 1
Patan
  • 17,073
  • 36
  • 124
  • 198
  • I believe that this question is a duplicate or slight variation on other questions on how to serialize XML. Please see: (1) http://stackoverflow.com/questions/6696382; and (2) http://stackoverflow.com/questions/11620147 – Sean B. Durkin Jul 31 '12 at 06:25

2 Answers2

0

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.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164
0

See this answer.

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

Community
  • 1
  • 1
Dimitre Novatchev
  • 240,661
  • 26
  • 293
  • 431