Want to see something interesting?
var xml:XML = XML(<feed><entry /><entry /><entry /></feed>);
trace(xml.entry.length())
It makes sense, right? Now add this attribute ...
var xml:XML = XML(<feed xmlns="http://www.w3.org/2005/Atom"><entry /><entry /><entry /></feed>);
trace(xml.entry.length())
It’s good that it’s not so. Try using it with a different attribute.
var xml:XML = XML(<feed test="okay"><entry /><entry /><entry /></feed>);
trace(xml.entry.length())
Does anyone know what might cause this? I used the atom as an example, but any attribute "xmlns" in the root of the node seems to have this effect. The return value is directly false - obviously, there are still 3 'input child nodes, regardless of the attributes their parents possess.
source
share