Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Missing encode info on XML header using XMLDOM

53bd72ae-00ce-4ab3-9471-6b3450c9aaadFeb 3 2016 — edited Feb 3 2016

Hi,

i want to print xml header with xmldom. The problem is, it prints only the xml version but missing the encode information.

What i got :

<?xml version="1.0"?>

What i want:

<?xml version="1.0"  encoding="UTF-8"?>

im using ORACLE 11g

And here is what i got so far:

doc     := xmldom.newdomdocument;

xmldom.setversion(doc,'1.0');        

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

mainNode := xmldom.makeNode(doc);

rootElmt := xmldom.createElement(doc,'Dokument');

rootNode := xmldom.appendChild (mainNode,xmldom.makeNode(rootElmt));

SetCurNode (rootNode);

dbms_lob.createTemporary(vClob,true); 

dbms_xmldom.writeToClob (doc,vClob);

xmldom.freedocument  (doc);

Thanks in advance,

Ivan

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 2 2016
Added on Feb 3 2016
1 comment
246 views