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 loading is not well formated for example an open tag is not closed. I get an error telling me that XML must be well formatted. I don't really ever plan on loading XML that is not well formatted but in case it ever does happen I would prefer to be able to handle it someway. First of all is there a way to tell if the loaded data is well formated before casting it as XML, and if possible try to fix it?