XSLT crashes when encountering Ampersand sign

ginstt

New Member
I am currently running in some trouble when trying to output a certain XML tag containing the Ampersand sign (&). So more concrete, when I try to output the following tag. I get an error\[code\]<fullname>Ben & Jerry</fullname>\[/code\]Using the following tag however runs just fine\[code\]<fullname>Ben and Jerry</fullname>\[/code\]I have tried it with the following code\[code\]<xsl:template match="fullname"> <xsl:apply-templates/></xsl:template>\[/code\]And I also tried\[code\]<xsl:template match="fullname"> <xsl:value-of-select="." disable-output-escaping="Yes"/></xsl:template>\[/code\]Both resulted in an error. The only way how I get it to work is by using CDATA like this\[code\]<fullname><![CDATA[Ben & Jerry]]></fullname>\[/code\]However, I have no control over the XML files I receive, and as such this is not a viable option. Is there something I can do within the XSLT to circumvent/fix this problem?Thanks!
 
Back
Top