xml - How do I escape special characters in XSLT -
i have following xml being output xslt
current output
<stem> <text> <p style="white-space: pre-wrap"> <span style="font-size:11;">how cost buy apple & pear if it's saturday?</span> </p> </text> </stem>
desired output
<stem> <text> <p style="white-space: pre-wrap"> <span style="font-size:11;">how cost buy apple & pear if it's saturday?</span> </p> </text> </stem>
i tried disable-output-escaping="no" had no effect:
i'm using
<xsl:value-of select="." disable-output-escaping="no"/>
thanks
if using xslt 2 (as use of saxon suggests) there feature called character maps fine-tune how output serialized. serialize apostrophes '
use:
<xsl:character-map name="escape-apos"> <xsl:output-character character="'" string="&apos;"/> </xsl:character-map> <xsl:output method="xml" use-character-maps="escape-apos"/>
Comments
Post a Comment