Click to See Complete Forum and Search --> : frustrated...keep getting nulls

05-10-2001, 05:08 PM
I'm not getting the values out of the nodes from a feed I have. What is missing from this code? I've done a few tutorials on xml and even was able to modify them and get the expected results, but this is my first from scratch...

Below is the script, and below that is the first "item" from the xml feed I'm using.

I've added traces to see where I'm at. It passes over the traces in the fuction dealing with nodeValues and goes right on to display the text one, so I know the function is getting called correctly....thanks for any help from anyone!


// loop through
function loop (xml) {

if (xml.firstChild.hasChildNodes) {
childNum = xml.firstChild.childNodes.length;
trace (childNum);
trace ("done");
} else {
trace ("no childNodes detected");

trace (xml.childNodes[0].childNodes);


// create new XML object

xmlObj = new XML();
xmlObj.ignoreWhite = true;

<?xml version="1.0"?>
<date>Friday, 04 May 01, 03:57:39 PM EDT</date>
<page>Motor Sports</page>
<headline><![CDATA[PONTIAC 400 QUALS]]></headline>
<teaser_text><![CDATA[If you don't have FX, NASCAR.com is the place to be this weekend. Catch all the action on RaceCast! Winston Cup Bud Pole Qualifying is now under way.<br>]]></teaser_text>
<page>Motor Sports</page>
<headline><![CDATA[Fans without FX out of luck Saturday night]]></headline>
<teaser_text><![CDATA[As hard as it is to understand FOX's logic in relegating one of the cooler races to a secondary channel, there's little question that the race will happen.