Hi, We're using a XSLT file to convert a XML into RSS complaint XML. The input XML contains an element with HtmlEncoded value like "#&174; " for characters like ® or ™. We want to assign the decoded value to the title element of the RSS feed. The problem is that, we need to display the title without any Htmlencoded characters. Can anyone give us some examples or pointers on how to achieve HtmlDecode functionality in XSLT language? Thanks.
Hi, Just wanted to add few more additional details to this post. The code snippet of the XSLT file which we are using is as shown below: <title> <xsl:value-of select="F[@N='1']"/> </title> Here we are trying to extract the value of the element with name F & attribute N & attribute value 1. The code snippet of the input XML looks like this: <F N="1"> Tailor Brand ®</F> After the transformation, the source of the output is as shown below: <title> Tailor Brand ® </title> However, the same logic is working properly & rendering the ®, when we place it under the <description> tag of the RSS XML. That is, <description> <xsl:value-of select="F[@N='1']"></xsl:value-of> </description> Can anyone provide some pointers on how to achieve the Htmldecoding inside the title tag of RSS also ? Thanks
I think your problem could be related to the encoding attribute of your "output method" for the xsl template. Normally feeds has encoding UTF-8 (<?xml version="1.0" encoding="utf-8"?>), and maybe your xslt has other method (not xml) or encoding like this: <xsl:output method="html" indent="yes" encoding="ISO-8859-1"/> Code (markup):
Hi, I checked my XSLT file & the statement is as follows: <xsl: output method="xml" indent="yes" encoding="UTF-8" /> Further, the final RSS XML contains the following as its header tag <?xml version="1.0" encoding="UTF-8"?> Should I include any namespace to the RSS XML root element to recognize these characters as HTML? Please enlighten ! Thanks