We call an API that returns a string of XML-formatted data. We would like to convert this string to a ColdFusion XML object through XMLParse (). A problem occurs when special characters are displayed in data values. For example, such characters:
— –
(yes, the source data contains them in an equivalent encoded in HTML). When executing XMLParse (), it generates an error for these encoded characters. Here is an example that will result in an error:
Part of our line:
<event>Hello World</event>
Mistake:
Reference to undefined entity " "
What is the best way to make these characters compatible with XMLParse ()? And more importantly, how can we do this if we do not always know what the symbols will be?
Thanks!
(this is on ColdFusion 6 server)