开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜