I remember how gloomy that the XML class in AS3 throws an exception if you try to pass data to it in a constructor that is not a valid XML string. But now I got a case where XML happily accepts all kinds of data regardless of whether the XML is correct or not ...
var xml:XML;
try
{
xml = new XML("Some bogus string content.");
_valid = true;
}
catch (err:Error)
{
_valid = false;
}
... am I missing something ??
Update: Qname is somehow null, but somehow it is not, see here:
var qname:QName = xml.name();
if (!qname.localName)
{
_valid = false;
}
... throws an exception. Obvioulsy qname null! But...
var qname:QName = xml.name();
if (!qname || !qname.localName)
{
_valid = false;
}
... does not raise any exceptions. It seems that qname is not null. Wth?
source
share