ice78991
Programmer
- Nov 20, 2006
- 216
Hello
I am trying to drill into the following xml file
<data>
<settings>
<loop>yes</loop>
</settings>
<stats>
<file>
<image>1.bmp</image>
<caption>Kresge</caption>
</file>
<file>
<image>2.bmp</image>
<caption>Ka</caption>
</file>
</stats>
</data>
I want to enumerate the number of <file> nodes
I am using the following
xmlNode = this.firstChild;
numberOfFiles=xmlNode.childNodes[1].childNodes.length;
but it's returning undefined
Where have I gone wrong?
I am trying to drill into the following xml file
<data>
<settings>
<loop>yes</loop>
</settings>
<stats>
<file>
<image>1.bmp</image>
<caption>Kresge</caption>
</file>
<file>
<image>2.bmp</image>
<caption>Ka</caption>
</file>
</stats>
</data>
I want to enumerate the number of <file> nodes
I am using the following
xmlNode = this.firstChild;
numberOfFiles=xmlNode.childNodes[1].childNodes.length;
but it's returning undefined
Where have I gone wrong?