I'm trying to parse xml into a dictionary based on a group id.
Actionscript Code:
var dic:Dictionary = new Dictionary();
var xml:XML = <data>
<item group="group a">item 1 from group a</item>
<item group="group b">item 1 from group b</item>
<item group="group a">item 2 from group a</item>
<item group="group a">item 3 from group a</item>
<item group="group a">item 4 from group a</item>
<item group="group b">item 2 from group b</item>
</data>
for each ( var item:XML in xml.item ) {
trace("item = "+item.@group);
}
the above is just dummy xml. The group ID could be anything. So I can't do if item.@group is == to "group a" and elseif and so on. Any ideas on how I could make it as dynamic as possible but still be able to access each group through a dictionary.