Beware malformed XML!
it seems flex swallows exceptions when try load malformed or invalid xml document follows. had document forgot close tags @ end , despite spending day in debugger stepping thru code never threw exception , unable catch try-catch. behavior saw load function below execute event handler onload below never fire.
public static function load():void{
var url:string = " http://someurl/malformed.xml";
var service:httpservice = new httpservice();
service.resultformat = "e4x";
service.url = url;
service.addeventlistener(resultevent.result, onload);
service.send();
}
private static function onload(event:resultevent):void{
var myxml:xmllistcollection = new xmllistcollection(event.result.*);
}
public static function load():void{
var url:string = " http://someurl/malformed.xml";
var service:httpservice = new httpservice();
service.resultformat = "e4x";
service.url = url;
service.addeventlistener(resultevent.result, onload);
service.send();
}
private static function onload(event:resultevent):void{
var myxml:xmllistcollection = new xmllistcollection(event.result.*);
}
yeah, flex pretty adamant "legal" xml structure. have experimented same thing. outputting data mysql via php proxy flex. didn't succeed many times, once realized mismatched tag cause onload event fail, started run xml through validator before sending out proxy bridge.
More discussions in Flex (Read Only)
adobe
Comments
Post a Comment