You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Rasmus Munk Jensen <mu...@writeme.com> on 2001/06/24 01:23:24 UTC

problems setting ProcessingInstruction node

Hi

I have some problems setting the ProcessingInstructionNode in the document.

To create a ProcessingInstructionNode,and append it to the document, I do
this:

docBuilder  = DocumentBuilderFactory.newInstance().newDocumentBuilder();
responseDOM = docBuilder.newDocument();
ProcessingInstruction proc = responseDOM.createProcessingInstruction("xml",
"version=\"1.0\" encoding=\"iso-8859-1\"");
responseDOM.appendChild(proc);



but when I read the XML output from the responseDOM, my processing
instruction is preceede by a "default" one:
<?xml version="1.0" encoding="UTF-8"?><?xml version="1.0"
encoding="iso-8859-1"?><data></data>

how do I remove, or replace the "default" processing instruction, so I can
end up with an ouput like this:
<?xml version="1.0" encoding="iso-8859-1"?><data></data>


thanks,

Rasmus



---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org