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 &amp; 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 &amp; pear if it&apos;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 &apos; use:

<xsl:character-map name="escape-apos">     <xsl:output-character character="&apos;" string="&amp;apos;"/> </xsl:character-map>  <xsl:output method="xml" use-character-maps="escape-apos"/> 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -