You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Alf Nilsson <al...@dataductus.se> on 2000/10/26 17:46:12 UTC

How to add a XMLDecl node to a DOM_Document

Hi,
I'm creating a DOM_Document in memory and I'm having a bit of a problem
with adding an XMLDecl node to a document.
My most recent try is this one:

>DOM_DocumentType tNewDocType;
>DOM_Document tNewDocument = impl.createDocument(0, "TestXMLDoc",
tNewDocType);
>DOM_XMLDecl tXMLDecl = tNewDocument.createXMLDecl("1.0", "UTF-8",
"no");
>tNewDocument.appendChild(tXMLDecl);
>
>DOM_Element tRootElement = tNewDocument.getDocumentElement();
....and so on.

Does anyone have any suggestions to how I should do?

Thanks in advance,
Alf Nilsson