# nodeValue returns "null"

**URL:** <https://forum.kirupa.com/t/nodevalue-returns-null/179915>\
**Category:** programming\
**Created:** [February 23, 2006, 11:08pm UTC](https://forum.kirupa.com/t/nodevalue-returns-null/179915 "2006-02-23T23:08:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Coremon](https://avatars.discourse-cdn.com/v4/letter/c/c68b51/32.png) [@Coremon](https://forum.kirupa.com/u/Coremon)\
**Post date:** [February 23, 2006, 11:08pm UTC](https://forum.kirupa.com/t/nodevalue-returns-null/179915/1 "2006-02-23T23:08:28Z")

</div>

I’m following a tutorial in a book called, “Flash Pro 8 Unleashed,” (610) and am running into trouble trying to trace the nodeValue for the elements in my xml file. Doing some other traces I found out that nodeType for all of the nodes is set to 1. Why? As an aside, tracing [SIZE=1]this.firstChild.childNodes\*.childNodes[j][/SIZE] returns as it should, (i.e. “[SIZE=1]\<name\>Paul\</name\>”[SIZE=2]). Thanks for any help…[/SIZE][/SIZE][SIZE=2]  
[/SIZE]  
**my code:**  
[SIZE=1]var myXML\_xml:XML = new XML();  
myXML\_xml.ignoreWhite = true;  
myXML\_xml.onLoad=function(success){  
if(success){  
for(var i:Number = 0; i\<this.firstChild.childNodes.length; i++){  
for(var j:Number = 0; j\<this.firstChild.childNodes\*.childNodes.length;j++){  
var nodeName:String = this.firstChild.childNodes\*.childNodes[j].nodeName;  
[COLOR=Red]var nodeValue:String = this.firstChild.childNodes\*.childNodes[j].nodeValue;[/COLOR]  
trace(nodeName+"="+nodeValue);  
}  
}  
}else{  
trace(“there was a major error!!”);  
}  
}  
myXML\_xml.load(“team1.xml”);[/SIZE]

\*\*the xml file: \*\*  
[SIZE=1]\<?xml version=“1.0”?\>  
\<team\>  
\<player\>  
\<name\>Paul\</name\>  
\<number\>15\</number\>  
\<position\>Point Guard\</position\>  
\</player\>  
\<player\>  
\<name\>Matt\</name\>  
\<number\>21\</number\>  
\<position\>Small Forward\</position\>  
\</player\>  
\<player\>  
\<name\>Doug\</name\>  
\<number\>33\</number\>  
\<position\>Center\</position\>  
\</player\>  
\<player\>  
\<name\>Todd\</name\>  
\<number\>51\</number\>  
\<position\>Power Forward\</position\>  
\</player\>  
\<player\>  
\<name\>Eddie\</name\>  
\<number\>11\</number\>  
\<position\>Shooting Guard\</position\>  
\</player\>  
\</team\>[/SIZE]
