XML Declaration
| Newsgroups | gmane.comp.mozilla.devel.xml |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <[email protected]> |
I would like to add an XML declaration to a Javascript generated
Document :
var doc = document.implementation.createDocument("", "", null);
var rootElem = doc.createElement("toto");
rootElem.setAttribute("version", "12334");
doc.appendChild(rootElem);
var serializer = new XMLSerializer();
serializer.serializeToStream(doc, foStream, "UTF-8");
I get no <?xml ..?> at the beginning of the file ! I tried to
appenChild a createProcessingInstruction("xml", "version='1.0'
encoding='UTF8'");
But with no success.
Thanks
Bruno