Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> missing header creating XML doc from XMLDOM

missing header creating XML doc from XMLDOM

From: plissken <plissken.ca_at_gmail.com>
Date: 5 Dec 2006 13:17:32 -0800
Message-ID: <1165353452.069759.182410@j72g2000cwa.googlegroups.com>


Can anyone help me with this problem. I'm using Oracle 9i and SQL Developer 1.0.0.15.27.

Here is some test code.

CREATE OR REPLACE PROCEDURE TEST AS
doc xmldom.DOMDocument;

main_node xmldom.DOMNode;
root_node xmldom.DOMNode;
root_elmt xmldom.DOMElement;
root_text xmldom.DOMText;
root_name xmldom.DOMNode;

v_cResult CLOB;

BEGIN doc := xmldom.newDOMDocument;

xmldom.setversion(doc, '1.0');
xmldom.setCharset(doc,'UTF-8');

main_node := xmldom.makeNode(doc);
root_elmt := xmldom.createElement(doc, 'EMP');
root_node := xmldom.appendChild(main_node, xmldom.makeNode(root_elmt));
root_text := xmldom.createtextnode(doc, 'where is the header?');
root_name := xmldom.appendChild(root_node, xmldom.makeNode(root_text));

dbms_xmldom.WRITETOCLOB(doc, v_cResult); dbms_output.PUT_LINE(substr(v_cResult,1,255)); xmldom.freeDocument(doc);
END; The output is

<EMP>where is the header?</EMP>

I really need

<?xml version="1.0" encoding="UTF-8" ?>
<EMP>where is the header?</EMP>

Thanks in advance.

Plissken. Received on Tue Dec 05 2006 - 15:17:32 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US