XML scripting examples?
Moderator: Paul Tuersley
Does anyone have any examples of reading in a XML file and using it in a script with the Extendscript tools? I have an older script that parses the file manually but just ran across the XML section in the CS4 Javascript Tools Guide. I wonder if I could overhaul this scrip by using the built in XML tools.
Here is some pseudocode to get started.
Code: Select all
var file = ...;
// read XML
var content = file.read();
var xml = new XML(content);
var elements = xml.elements(); // retrieve all elements at root level in standard array
...
// write XML
var content = "... xml content ...";
file.write(content);