XML problems

Hey, I have a little problem with my XML.


<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]


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.

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.

no problem =)