Not understanding why this isn't reading the childs text

wxdqz

New Member
Hello, this is my first post here. I admit to being a newbie to XML, but I never thought I was a total idiot, until now. I can almost always find coding answers online, through documentation or finding tutorials that help me. This post comes at the end of 10+ hours of searching.

I have an XML file that looks like this:

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<rtdata>
<SacramentoArea>
<store1602>
<name>Biggs Feed</name>
<inv>340</inv>
<date>Oct 30 2007 1:30PM</date>
</store1602>
<store3502>
<name>Bobs Barn</name>
<inv>510</inv>
<date>Oct 30 2007 1:30PM</date>
</store3502>
<store3526>
<name>Seans Chateau</name>
<inv>409</inv>
<date>Oct 30 2007 1:30PM</date>
</store3526>
</SacramentoArea>
</rtdata>

I want to be able to grab the chunk of data based on the store, then read all the data in that. So, I want the data of the 3 siblings that are under the store* tag.

I use the javascript function xmlDoc to help grab the data. This is what I try:

alert(xmlDoc.getElementsByTagName('store1602')[0].firstChild.nodeValue);

I think this should alert 'Biggs Feed', but it just is blank. I've tried all kinds of ways, and I'm going crazy. Can someone show me the proper DOM statement I need to get to that? Many thanks in advance. I'm getting gray hairs here.
 
Back
Top