Appreciate the pointer
Pete, December 14, 2010 - 4:50 am UTC
Hi Tom,
I have raised this question on the XML forum as suggested.
Unfortunately, I have not currently had a response.
Would you be prepared to post this, so that perhaps someone who visits your site regularly, might have encountered this issue before?
Many thanks for responding.
Mike Kutz, December 14, 2010 - 1:50 pm UTC
http://forums.oracle.com/forums/thread.jspa?threadID=990936&tstart=405 line 8 is different
SQL> list
1 declare
2 l_xml XMLDom.DomDocument;
3 l_mainNode xmldom.DOMNode;
4 l_xmltype xmltype;
5 begin
6 l_xml := xmldom.newDomDocument;
7 l_mainNode := xmldom.makeNode( l_xml );
8 dbms_xmldom.setVersion( l_xml, '1.0" encoding="UTF-8' );
9 dbms_xmldom.setCharset( l_xml, 'UTF-8' );
10 l_xmltype:= dbms_xmldom.getxmltype ( l_xml );
11 dbms_output.put_line ( l_xmltype.getStringVal( ) );
12* end;
SQL> /
<?xml version="1.0" encoding="UTF-8"?>
PL/SQL procedure successfully completed.
Works fine
Pete, December 15, 2010 - 8:38 am UTC
Hi Mike,
Thanks for finding this.
Much appreciated.
Pete
December 15, 2010 - 11:46 am UTC
indeed, thanks!
dbms_xmldom.writeToFile(doc, xmlfile, 'UTF-8');
Felix, February 24, 2011 - 10:56 pm UTC
about the charset problem when creating xml file using dbms_xmldom, we can use
dbms_xmldom.writeToFile(doc, xmlfile, 'UTF-8');
to specify the xml encoding type.
And also, there is no need to wtire:
dbms_xmldom.setversion(doc, '1.0" encoding="UTF-8');
Hope this will help U~
BR,
Felix.Xu