XML declaration
When writing an XML object to file is it possible to include the XML declaration?
I've tried the toXMLString() function and that doesn't seem to work, I get the XML file contents just fine but no declaration.
I've tried adding it as a string literal like so (the book object is simple an XML object containing all of the book contents):
var xmlFile = File(chapterFolder+app.activeDocument.name.replace(".indd","")+".xml");
xmlFile.open('w');
xmlFile.encoding = 'UTF-8';
xmlFile.write("""<?xml version="1.0" encoding="UTF-8"?>"""+"\r"+book.toXMLString());
xmlFile.close();
Is there a property I'm missing that would allow me to have the declaration included automatically?
Cheers,
Kurtis
