如何判断AS3中的XMLlist对象是否包含节点?
如何判断AS3中的XMLlist对象是否包含特定节点? 例如:您有这个XML文件 一如何判断AS3中的XMLlist对象是否包含节点?,xml,actionscript-3,xmllist,Xml,Actionscript 3,Xmllist,如何判断AS3中的XMLlist对象是否包含特定节点? 例如:您有这个XML文件 一 要检查此文件中是否存在带标记的子项?使用了以下简单代码: 如果pp在XMLlist中{ 痕迹存在 }使用了以下简单的代码: 如果pp在XMLlist中{ 痕迹存在 } var xml:XML = <items> <item>one</items> </items>; // my favorite method (works also for testin
要检查此文件中是否存在带标记的子项?使用了以下简单代码: 如果pp在XMLlist中{ 痕迹存在
}使用了以下简单的代码: 如果pp在XMLlist中{ 痕迹存在 }
var xml:XML = <items> <item>one</items> </items>;
// my favorite method (works also for testing attributes)
if (xml.pp.length()) {
// xml contains one or more <pp> child elements
}
else {
// xml contains no <pp> child elements
}