Skip to content
fabiantheblind edited this page Mar 23, 2014 · 2 revisions

Extendscript has its own way of creating xml objects. It looks a bit wired and breaks every linter, but it works. Take a look into the JavaScript Tools Guide.pdf. You can find it in the ExtendScript Toolkit under "Help>JavaScript Tools Guide"

Here an short example.

var root = new XML('<root/>');
var child = new XML('<achild/>');
var val = 12;
var otherchild = <something name={val}></something>;
child.@number = 12;
child.appendChild (otherchild);
root.appendChild (child);
$.writeln(root.toXMLString());

The console result is:

<root>
  <achild number="12">
    <something name="12"/>
  </achild>
</root>
Clone this wiki locally