Reputation: 2075
I want to decode HTML tags from a string and used:
disable-output-escaping="yes"
That was working properly until the string contained ®
(meaning ®).
Then I found that a possible solution is to replace ®
with ®
; but it is not working.
i am using this code
<xsl:if test="$ShortDescription !=''">
<shortdescription><xsl:value-of select="replace($ShortDescription,'®','®')" disable-output-escaping="yes"/></shortdescription>
</xsl:if>
The XSLT file giving me the error looks like this:
HTTP Status 500 - {msg=getTransformer fails in getContentType,trace=java.lang.RuntimeException: getTransformer fails in getContentType at
and when i am not used replace function then its give error look like: XML Parsing Error: undefined entity at
<shortdescription>Wear some adventure with the same hat Indiana Jones® wears in his movies.</shortdescription>
Upvotes: 0
Views: 905
Reputation: 163595
If the input file contains the entity reference ®
and contains no entity definition for this entity, then it's not well-formed XML which means you can't process it using XSLT. Possible solutions include:
®
by ®
using non-XML technology before parsing, e.g. sed/awk/PerlUpvotes: 1