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
Post a Comment