Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid Character in CDATA

Status
Not open for further replies.

BountyHunter2

Programmer
Feb 12, 2003
10
0
0
GB
Hi,

I thought that a whatever was inside a CDATA section was not meant to be parsed... So why does the below generate an error on the "£" characted???

<headline><![CDATA[SILVERSTONE GETS £4M UPGRADE]]</headline>

The error message is...

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

--------------------------------------------------------------------------------

An invalid character was found in text content. Error processing resource ' Line 185, Position 37

<headline><![CDATA[SILVERSTONE GETS


This XML is from a news feed, so if it's a problem for me i assume it would be a problem for everyone else as well.
 
Fixed it. The xml feed does not specify an encoding paramater. It works fine by adding encoding=&quot;iso-8859-1&quot; in the first line.
 
It should have been OK, because if you skip the encoding parameter, it defaults to UTF-8 Unicode, and the &quot;Pound&quot; symbol is indeed defined in it.

Could it have been that your XML and XSL didn't have the same encoding? What do you have for the xsl:eek:utput options?

Chip H.
 
Hi Chip,

I think you're right. The XSL was different because it had the &quot;ISO-8859-1&quot; set, so it must've been conflicting with the XML defaulting to UTF-8.

I can now remove my &quot;fix&quot; of adding the extra parameter in the XML file.

Thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top