简体   繁体   中英

checking an empty XML, XMLList or XMLListCollection in flex4

如何检查Flex4中的XML,XMLListCollection或XMLList是否没有元素或包含至少一个或多个元素?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM