We call an API that returns a string of XML-formatted data. We'd like to convert this string into a ColdFusion XML object, via XMLParse(). A problem occurs when special characters show up in the data values. For example, characters like this:
— –
(yes, the raw data contains them in their HTML encoded equivalent). When doing the XMLParse(), it throws an error on these encoded characters. Here is an example that will error:
Part of our string:
<event>Hello World</event>
Error:
Reference to undefined entity " "
What's the best method to make these characters compatible with the XMLParse()? And even more important - how can we do this if we don't always know what the characters will be?
Thanks!
(this is on a ColdFusion 6 server)