# Display all atributes from XML Document

**URL:** <https://forum.kirupa.com/t/display-all-atributes-from-xml-document/296533>\
**Category:** flash\
**Created:** [September 16, 2009, 6:43am UTC](https://forum.kirupa.com/t/display-all-atributes-from-xml-document/296533 "2009-09-16T06:43:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mihaispr](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mihaispr](https://forum.kirupa.com/u/mihaispr)\
**Post date:** [September 16, 2009, 6:43am UTC](https://forum.kirupa.com/t/display-all-atributes-from-xml-document/296533/1 "2009-09-16T06:43:15Z")

</div>

Hi everyone and thanks for reading my question!

I have the following XML document that has exactly this structure:

![](http://img41.imageshack.us/img41/4435/xmldocument.png)

What I want to do is to display on Output panel the attributes (the text that is appearing) in tags item1 and item2.

So in my output panel in flash I want to display:

```auto

Actionscript 2 si XML
 Actionscript 2 tutorial si XML

```

How I can achieve that?

So as you can see I want to display all attributes from tag named titlu in my xml document named elementradacina.xml.

Here’s the code tried in my fla file:

```auto

// loads XML document in Flash with the name specified

// in this case loads elementradacina.xml document in Flash

// create object xmldocument from class XML

var xmldocument:XML = new XML()

// we set ignoreWhite property to true

xmldocument.ignoreWhite = true;

xmldocument.onLoad = function(succes:Boolean):Void
{// variable succes specifies if the document XML was loaded or not in Flash
if(succes)
// node root has a variable named xmlRoot that is object of class XMLNode

//node root name is <elementradacina>
 {var xmlRoot:XMLNode = this.firstChild; 
 
 // reference to item tags specify by variable xmlItem
  var xmlItem:XMLNode;
 
 for (var i:Number = 0; i<xmlRoot.childNodes.length;i++)
   {
       xmlItem = xmlRoot.childNodes*;
       trace(xml.attributes.title);

//trace(xml.attributes.titlu);
   }
 }
};
xmldocument.load("elementradacina.xml");

```
