I have a function that loads in some XML that looks like this:
private function onXMLLoad(e:Event):void
{
trace(e.target.data);
hideLoading();
DataModel.instance.data = XML(e.target.data);
updateSelections();
toggleExpand();
}
If the XML data that is being loaded is poorly formed, for example, the open tag is not closed. I get a message that XML should be well formatted. I actually never plan to download XML, which is not well formatted, but in case this ever happens, I would rather be able to process it somehow. First of all, is there a way to determine if the uploaded data is well formed before using it as XML, and if possible, try to fix it?
source
share