# XML problems

**URL:** https://forum.kirupa.com/t/xml-problems/185784
**Category:** Uncategorized
**Created:** [April 16, 2006, 2:33pm UTC](https://forum.kirupa.com/t/xml-problems/185784 "2006-04-16T14:33:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Zelwyn](https://avatars.discourse-cdn.com/v4/letter/z/3e96dc/32.png) [@Zelwyn](https://forum.kirupa.com/u/Zelwyn)
#### Post date: [April 16, 2006, 2:33pm UTC](https://forum.kirupa.com/t/xml-problems/185784/1 "2006-04-16T14:33:02Z")

</div>

Hey, I have a little problem with my XML.

```auto

<family>
    <parent gender="female" name="Mom" />
    <parent gender="male" name="Dad" />
    <children>
        <child gender="male" name="Billy" />
        <child gender="female" name="Janine" />
        <child gender="male" name="Joe" />
    </ children>
    <uncle gender="male" name="Daniel" />
</ family>

```

And then my as goes kinda, exactly, like so.  
[FONT=Courier New] [/FONT]

```auto

family_xml = new XML();
family_xml.ignoreWhite = true;
family_xml.onLoad = function(loaded) {
    if (loaded) {
        trace("My uncle is "+this.firstChild.childNodes[3].attributes.name+".");
    } else {
        trace("Could not load familyTree.xml");
    }
};
family_xml.load("familyTree.xml");

```

So, what I’m trying to acomplish here is the satisfying output of “My uncle is Daniel.” However, I’m getting “My uncle is undefined.” Does anybody know why this happens? I would like to figure it out fast. I’m learning about XML for a pretty big project.

---

<div class="post-metadata">

### Author: ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)
#### Post date: [April 17, 2006, 5:12am UTC](https://forum.kirupa.com/t/xml-problems/185784/2 "2006-04-17T05:12:51Z")

</div>

There’s an extra space in \</ children\> and \</ family\> they should read  
\</children\> and \</family\>

scotty(-:

---

<div class="post-metadata">

### Author: ![Zelwyn](https://avatars.discourse-cdn.com/v4/letter/z/3e96dc/32.png) [@Zelwyn](https://forum.kirupa.com/u/Zelwyn)
#### Post date: [April 17, 2006, 12:22pm UTC](https://forum.kirupa.com/t/xml-problems/185784/3 "2006-04-17T12:22:49Z")

</div>

> [@scotty](#):
>
> There’s an extra space in \</ children\> and \</ family\> they should read  
> \</children\> and \</family\>
> 
> scotty(-:

The spaces shouldn’t matter. It ignores whitespace, and any other references work. It’s just the uncle tag that isn’t working. Even If I make it trace the whole file (trace(this.firstChild);, it shows everything but the uncle. I’ll try that, though.

EDIT: Did that. It worked. TNX.

---

<div class="post-metadata">

### Author: ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)
#### Post date: [April 17, 2006, 5:58pm UTC](https://forum.kirupa.com/t/xml-problems/185784/4 "2006-04-17T17:58:51Z")

</div>

no problem =)
