# How can I read out this XML?

**URL:** <https://forum.kirupa.com/t/how-can-i-read-out-this-xml/154981>\
**Category:** flash\
**Created:** [July 14, 2005, 12:20am UTC](https://forum.kirupa.com/t/how-can-i-read-out-this-xml/154981 "2005-07-14T00:20:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mh22gw](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@mh22gw](https://forum.kirupa.com/u/mh22gw)\
**Post date:** [July 14, 2005, 12:20am UTC](https://forum.kirupa.com/t/how-can-i-read-out-this-xml/154981/1 "2005-07-14T00:20:03Z")

</div>

I havé an XML-file with this structure.  
[size=2][color=#0000ff]  
[/color][/size]

```auto
 <?xmlversion="1.0"encoding="utf-8"?> 
<links name="Länkar">
<subject name="Skolan">
<link nr="1">
<linkname name="HIK"/>
<link href="http://www.hik.se"/>
</link>
<link nr="2">
<linkname name="Webbprogrammering"/>
<link href="https://www.te.hik.se/tekinet/kurser/dtt/wp/"/>
</link>
<linknr="3">
<linkname name="Actionscript"/>
<link href="http://www.te.hik.se/tekinet/kurser/dtt/wp_action/index.php?sida=start"/>
</link>
</subject>

```

[size=2][color=#0000ff]how do I do to read out the data from this file? I have managed to find out how to read the first and second level. I think I need a new for-loop to get all data inside the “link-tag”, but Im not sure. My code looks like this.[/color][/size]

```auto
 System.useCodepage = true; 
var xmlTreeData:XML = new XML();
xmlTreeData.load("links.xml");
xmlTreeData.ignoreWhite = true;
xmlTreeData.onLoad = function(bSuccess:Boolean):Void {
if(bSuccess) {
var xmlnRoot:XMLNode = xmlTreeData.firstChild;
var aNodes:Array = xmlnRoot.childNodes;
trace(this.firstChild.attributes.name)
for(var i:Number = 0; i < aNodes.length; i++) {
trace(this.firstChild.childNodes*.attributes.name);
 
} 
}
else {
trace("Filen gick inte att ladda.");
}
};

```

[size=2][color=#0000ff]I hope somebody can help me…  
[/color][/size]
