I'm a bit of a noob with parsing XML with coldfusion and I could use some help with an issue. I'm trying to parse the following XML file; http://www.bbc.co.uk/travelnews/tpeg/en/local/rtm/rtm_tpeg.xml and I get the following error; Character conversion error: "Illegal ASCII character, 0xe9" (line number may be too low). The error occurred on line 9. I can post my code if this is helpful? But it works fine when parsing a different XML file. Any ideas?
The code is very simple; <cfscript> URLToPull = "http://www.bbc.co.uk/travelnews/tpeg/en/local/rtm/rtm_tpeg.xml"; </cfscript> <cfhttp url="#URLToPull#" method="GET" timeout="0"></cfhttp> <cfscript> XMLContent = trim(cfhttp.filecontent); XMLContent = XMLParse(XMLContent); </cfscript> <cfdump var="#XMLContent#"> Code (markup): I think this should be ignored beacuse coldfusion uses a DOM parser, what ideally needed is a SAX parser due to the size of the XML file and the processing speeds. I can't find any documentation online of using the java SAX parser with coldfusion. Does anybody have any knowledge on this?
That should work, but like Paul said, likely charset issue. And I don't encourage using the XMLparse if you're looking to display the output real-time. It's very slow. I've had instances where I'd just store the data from the struct into a table for output provided you don't have to pull data real-time.
Thanks for your help. I'm going to try another method to pull in this information by creating a web service and pulling the information in from there. This should handle the data much more efficiently.