actionscript 3 - as3 xml check if element exists -


i want check if element in structure exists each child. problem children don't have same name (product,prepack) , don't want change order. additionally can't change xml structure.

<items>     <product>         <resourceimages>             <image />         </resourceimages>     </product>     <product>         <resourceimages>             <image />         </resourceimages>     </product>     <prepack>         <resourceimages />     </prepack>     <product>         <resourceimages>             <image />         </resourceimages>     </product>     <prepack>         <resourceimages />     </prepack> </items> 

like this?

for each(var item : xml in xmldata.children()) {     var hasimages : boolean = (item.resourceimages.children().length() > 0);      if(hasimages)         trace("item has images") } 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -