If the XML format is like :
<root>
<banana>
<apple>
<description language=”EN” title=”title EN” id=”1″>Hello</description>
<description language=”DE” title=”title DE” id=”1″>Hello 2</description>
</apple>
<apple>
<description language=”EN” title=”title EN” id=”1″>Hello</description>
<description language=”DE” title=”title DE” id=”1″>Hello 2</description>
</apple>
</banana>
<apple>
<description language=”EN” title=”title EN” id=”1″>Hello</description>
<description language=”DE” title=”title DE” id=”1″>Hello 2</description>
</apple>
</root>
then….to parse title attribute value….do the following things:
<mx:Application xmlns:mx=http://www.adobe.com/2006/mxml initialize=”LoadXML();”>
<mx:XML id=”urlPath” source=”assets/xmlfile.xml”/>
private var fruitsArray:ArrayCollection = new ArrayCollection();
public function LoadXML():void{
//Alert.show(“fruits====”+urlPath..apple.length());
for(var i:int;i < urlPath.banana.apple.length();i++){
var appleString:String = urlPath.banana.apple[i].description[0].@title;
fruitsArray.addItemAt({fruitsTitle:appleString},i);
<mx:DataGrid dataProvider=”{fruitsArray}” width=”100%” height=”100%” verticalGridLines=”false”>
<mx:DataGridColumn headerText=”Fruits” dataField=”fruitsTitle” />