-
XML Parsing problem (with XML Object)
Hi there!
I need to parse GPX data to create a new composition. It’s actually just a XML file with GPS data.
Here is an example how I create XML object:
var myFile = File.openDialog("Choose GPX file","*.*");function readXMLFile(file) {
if (!file.exists) {
throw "Cannot find file: " + deodeURI(file.absoluteURI);
}
file.encoding = "UTF8";
file.lineFeed = "unix";
file.open("r", "TEXT", "????");
var str = file.read();
file.close();
return new XML(str);
};var ch = readXMLFile(myFile);
ch return whole XML file and it’s OK. Unfortunately when I try to retrieve a children nodes it returns nothing.
Below is my XML file.
<?xml version="1.0" encoding="UTF-8"?>
I found there is an elements() function but it works strange.
Sorry, there were no replies found.