checking an empty XML, XMLList or XMLListCollection in flex4
how do i check if an XML,XMLListCollection or XMLList has no element or contains atleast one or more 开发者_如何学编程elements in flex4?
How about using the contains() method ?
sample from docs:
var xml:XML =
<order>
<item>Rice</item>
<item>Kung Pao Shrimp</item>
</order>;
trace(xml.item[0].contains(<item>Rice</item>)); // true
trace(xml.item[1].contains(<item>Kung Pao Shrimp</item>)); // true
trace(xml.item[1].contains(<item>MSG</item>)); // false
精彩评论