tags:

views:

70

answers:

1
> <root>
> 
> <module c_name="Executive Library">
> <node cd_title="Document One"
> cd_link="http://localhost/userMana/upload/feature.xml"/&gt;
> </module> <module c_name="Rate Card"/>
> 
> <module c_name="Time Sheet"> <node
> cd_title="Document Two"
> cd_link="http://localhost/userMana/upload/epl-v10.html"/&gt;
> </module> </root>

<mx:Tree dataProvider="{tree.module}" labelField="@c_name" borderThickness="0" x="28" y="56" width="350" height="414"></mx:Tree>

I am able to read the module name, but how can i read the cd_title, when the label field is different.

+1  A: 
var yourXML:XML = yourXMLData;

for each(var x:XML in yourXML.module)
{
    trace(x.node.@cd_title);
}

havent tested it but it should work. You may want to build an ArrayCollection formatted for the Tree then set that as the dataprovider

Check these links: accessing XML, using xml as dataprovider

Chris Klepeis