the long way to do it is as follows:
PHP Code:
var xml:XML = <root>
<component name="gun" size="0"></component>
<component name="gun"></component>
</root>;
var count:uint=xml.component.length();
while (count--){
var size:String = xml.component[count].@size.toString();
if(size.length > 0){
trace("component " + count + " has size set.");
};
}
however, you can grab all the components that have a size that meets a certain comparison really easily in an xml list, then perform actions on that list:
PHP Code:
var xml:XML = <root>
<component name="gun" size="0"></component>
<component name="gun" size="2"></component>
<component name="gun" size="5"></component>
<component name="gun" size="10"></component>
<component name="gun"></component>
<component name="gun"></component>
<component name="gun"></component>
</root>;
var hasguns:XMLList = xml.component.(attribute("size") > 1);
var count:uint=hasguns.length();
while (count--){
trace(hasguns[count].@size);
}