1. 根据节点属性查找:
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
var
flexXML:XML
=
< RIA >
< FlashPlayer >
< Flash version = " 9 " > Flash CS3 < / Flash>
< Flash version = " 8 " > Flash 8 < / Flash>
< Flash version = " 7 " > Flash 2004MX < / Flash>
< Flex > Flex3 < / Flex>
< / FlashPlayer>
< Ajax >
< GoogleAjax > GoogleAjax1. 0 < / GoogleAjax>
< / Ajax>
< / RIA>;
trace(flexXML.FlashPlayer.Flash.(attribute( " version " ) > 7 ));
< RIA >
< FlashPlayer >
< Flash version = " 9 " > Flash CS3 < / Flash>
< Flash version = " 8 " > Flash 8 < / Flash>
< Flash version = " 7 " > Flash 2004MX < / Flash>
< Flex > Flex3 < / Flex>
< / FlashPlayer>
< Ajax >
< GoogleAjax > GoogleAjax1. 0 < / GoogleAjax>
< / Ajax>
< / RIA>;
trace(flexXML.FlashPlayer.Flash.(attribute( " version " ) > 7 ));
2. 根据节点内容查找:
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
var
flexXML1:XML
=
< RIA >
< FlashPlayer >
< Flash >
< Name > Flash CS3 < / Name>
< Version > 9 < / Version>
< / Flash>
< Flash >
< Name > Flash 8 < / Name>
< Version > 8 < / Version>
< / Flash>
< Flash >
< Name > Flash 2004MX < / Name>
< Version > 7 < / Version>
< / Flash>
< Flex > Flex3 < / Flex>
< / FlashPlayer>
< / RIA>
trace(flexXML1.FlashPlayer.Flash.(Version > 7 ));
< RIA >
< FlashPlayer >
< Flash >
< Name > Flash CS3 < / Name>
< Version > 9 < / Version>
< / Flash>
< Flash >
< Name > Flash 8 < / Name>
< Version > 8 < / Version>
< / Flash>
< Flash >
< Name > Flash 2004MX < / Name>
< Version > 7 < / Version>
< / Flash>
< Flex > Flex3 < / Flex>
< / FlashPlayer>
< / RIA>
trace(flexXML1.FlashPlayer.Flash.(Version > 7 ));
查找返回的是 XMLList对象。