actionscript 3 - AS3 XML object not throwing exception if invalid data is given? -
i remember darkly xml class in as3 throw exception if tried give data in it's constructor not valid xml string. got case xml happily takes every kind of data no matter it's valid xml or not...
var xml:xml; try { xml = new xml("some bogus string content."); _valid = true; } catch (err:error) { _valid = false; }
... missing something??
update: qname somehow null somehow it's not, see here:
var qname:qname = xml.name(); if (!qname.localname) { _valid = false; }
... throws exception. obvioulsy qname null! ...
var qname:qname = xml.name(); if (!qname || !qname.localname) { _valid = false; }
... doesn't throw exception. qname seems not null. wth?
your example should give xml object no name , nodekind equal "text". how text nodes represented in xml. in addition try/catch, may check name().
Comments
Post a Comment