# Parsing XML

**URL:** <https://forum.kirupa.com/t/parsing-xml/249588>\
**Category:** flash\
**Created:** [January 20, 2008, 3:49pm UTC](https://forum.kirupa.com/t/parsing-xml/249588 "2008-01-20T15:49:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![theonlycarmire](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@theonlycarmire](https://forum.kirupa.com/u/theonlycarmire)\
**Post date:** [January 20, 2008, 3:49pm UTC](https://forum.kirupa.com/t/parsing-xml/249588/1 "2008-01-20T15:49:15Z")

</div>

Hey guys, got a question for you.

I have an XML document that looks like this:

```auto

<?xml version="1.0" encoding="iso-8859-1"?>
<buildYourOwnItems>
    <!-- BASE -->
    <item name="base">
        <name>base</name>
        <thumb>gfx/thumbs/base.png</thumb>
        <image>gfx/base.png</image>
        <price>$7000</price>
    </item>
    <!-- STEEL TABLES -->
    <item name="table1">
        <name>table1</name>
        <thumb>gfx/thumbs/table1.png</thumb>
        <image>gfx/table1.png</image>
        <price>$7000</price>
    </item>
</buildYourOwnItems>

```

I want to parse this in Actionscript3. I can return the attributes (name=“base”), but cannot receive the values of just the nodes. When I use this code:

```php

loader.load(req);

loader.addEventListener("complete", init);

function init(e:Event){
  doc.ignoreWhite = true;
  xml = XML(loader.data);
  doc.parseXML(xml.toXMLString());
  for(var i = 0; i<doc.firstChild.childNodes.length; i++){
    //trace(doc.firstChild.childNodes*.attributes.name);
    trace(doc.firstChild.childNodes*.firstChild);    
  }
}

```

(The commented line would return the attribute)

I get the full tag. How can I isolate just the node value??

Thanks!

-theonlycarmire
