Working with XML in flex
I'am working with an hierarchical xml structure like this:
<employee name="AAA" group="1"..../>
<employee name="BBB" group="1"...>
<employee name="CCC" group="1".../>
</employee>
<employee name="DDD" group="0"... />
<employee name="EEE" group="0"... />
</employee>
First I need to count all employee nodes (including root node). It must
be: 5. I have tried using xml..employee.length() but it returns 4 (does
not include the root node "AAA") If I tried xml.employee.length() only
returns 1
Then, I have to create a XMList with specific search. For example all the
nodes with attribute group="1"
The same problem occurs, I use: hitList:XMLList = xml..employee.(@group ==
"1") and returns the right result but it does not take in count the root
node (in this case, it must be included)
How can I do this operations including the root node?
Thanks in advance
Cristian
No comments:
Post a Comment