开发者

checking an empty XML, XMLList or XMLListCollection in flex4

开发者 https://www.devze.com 2023-03-06 16:39 出处:网络
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 ?

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

精彩评论

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