Does the XML object actually work?
Posted: December 23rd, 2011, 2:28 am
Hello,
I'm trying to read an XML with the XML object but I'm getting unexpected results. I'm using the following code to read in the XML and then create an XML object.
That actual XML is very simple and looks like this:
If I run the command: according to the docs I should get "Project" back but I get nothing. If I call length() on the returned list I get 0. I tried running the code with a string too instead of reading the file and got the same result. Does this mean the XML object ins't working or is it something I'm doing wrong?
I'm trying to read an XML with the XML object but I'm getting unexpected results. I'm using the following code to read in the XML and then create an XML object.
Code: Select all
function parseXML(path)
{
var xml_file = new File(path);
xml_file.open ("r", "XML");
var lines = xml_file.read();
xml_file.close();
return new XML(lines);
}
Code: Select all
<RootNode>
<Project></Project>
</RootNode>
Code: Select all
xml.RootNode;