Server Side XML Class
Hi,
Everything I read in from my XML is of nodeType Element. I am trying to extract the data. However because the type coming back is of type 1 (Element) I am unable to use nodeValue. What am I doing wrong? I wish to extract the directory and server information.
This is my XML
<?xml version="1.0" encoding="UTF-8"?>
<mainlist version="1" xmlns="http://xspf.org/ns/0/">
<subList>
<id>
<title></title>
<creator></creator>
<directory>dir_data_here</directory>
<meta rel="server">server_info_here</meta>
<meta rel="version">version_here</meta>
</id>
</subList>
</mainlist>
This is my code:
// Create a new XML object.
var flooring = new XML();
//load in the external xml data
flooring.load("data.xml");
// Set the ignoreWhite property to true (the default value is false).
flooring.ignoreWhite = true;
// After loading is complete, trace the XML object.
flooring.onLoad = function(success) {
//trace(flooring);
trace( flooring.childNodes[0].childNodes[0].childNodes[0].parentNode);
trace( flooring.childNodes[0].childNodes[0].childNodes[0].nodeValue);
trace( flooring.childNodes[0].childNodes[0].childNodes[0].nodeType);
trace( flooring.childNodes[0].childNodes[0].childNodes[0].nodeName);
trace(flooring.childNodes[0].childNodes[0].childNodes[0].toString());
}
reference:
Many thanks.
