Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects XML Parsing problem (with XML Object)

  • XML Parsing problem (with XML Object)

    Posted by Tomasz Tejchman on July 16, 2012 at 10:35 am

    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.

    Tomasz Tejchman replied 14 years, 1 month ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy