Forum Moderators: open
It seems to work fine and I can traverse my tree and print out nodeName(s) but not nodeValue(s). What am I doing wrong? My firebug extension is showing me that my XML returned the information fine.
Here is my XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<products>
<product pr_id="1">
<name>washing machine</name>
<details>hoover washing machine, 3yr warranty etc</details>
</product>
</products>
Nibinaear
[edited by: tedster at 10:11 pm (utc) on Jan. 22, 2008]
var pr_name= product_node.firstChild.nodeValue;
var pr_details= product_node.firstChild.nextSibling.nodeValue;
Here's what you're getting:
<products>
<product> <-- This is product_node.firstChild
...
</product>
<product> <-- This is product_node.firstChild.nextSibling
...
</product>
</products>