XML Declaration

[email protected]
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.