Home » Developer & Programmer » JDeveloper, Java & XML » XML - CLOB - CharacterSet Problem
XML - CLOB - CharacterSet Problem [message #134305] Wed, 24 August 2005 04:35 Go to next message
marrec
Messages: 35
Registered: May 2005
Location: Mühlheim, Germany
Member
hello,

i'm having a prob with charactersets.
i programmed a xml-solution, which writes a xml-file using xmldom. this file can contain umlaut (ä,ö etc.).
i load the file into another database using following code:

l_bfile := BFILENAME('VR_XML_IN', p_filename);

DBMS_LOB.createtemporary (l_clob, TRUE);
DBMS_LOB.fileopen(l_bfile, DBMS_LOB.file_readonly);
DBMS_LOB.loadfromfile(l_clob, l_bfile, DBMS_LOB.getlength(l_bfile));
DBMS_LOB.fileclose(l_bfile);

INSERT INTO XML_TABLE (
CONTENT)
VALUES
(
XMLTYPE.CreateXML(l_clob)
);

in out test-environment this works very well - we use characterset: WE8MSWIN1252
in real-environment, all umlauts are changed - when i debug with toad, i watch l_clob and see, instead of 'ä' vice versa question marks and stuff like this.
They work with: WE8ISO8859P15.
Both use MS-Windows 2k Server as Database Server OS.
Oracle Version is 9.2.x

maybe someone who knows a solution?

thx in advance,
marrec

in out test-environment this
Re: XML - CLOB - CharacterSet Problem [message #134371 is a reply to message #134305] Wed, 24 August 2005 09:47 Go to previous messageGo to next message
marrec
Messages: 35
Registered: May 2005
Location: Mühlheim, Germany
Member
so, after a lot of test an readings i'm one step further.

the output routine, uses following code to export xml-data to a file:

DBMS_LOB.CreateTemporary(v_xml_clob, TRUE);
xmldom.writetoclob(doc,v_xml_clob);

v_xml_content := new xmltype(v_xml_clob);
INSERT INTO XML_TAG
(CONTENT)
VALUES ( v_xml_content);
xmldom.writeToFile(doc, v_path || '\' || v_filename);

So in my xml-type column in table XML_TAB, everything is okay!
but in the output-file there is no umlaut.

can i write the xml-data with this function in some other format like UTF8 or ISO8859-1?
Re: XML - CLOB - CharacterSet Problem [message #134476 is a reply to message #134371] Thu, 25 August 2005 02:46 Go to previous message
marrec
Messages: 35
Registered: May 2005
Location: Mühlheim, Germany
Member
yippieheiye,

i got it!

with the function xmldom.getCharSet i saw that the xmldocument had the character set 'AL32UTF8'.
xmldom.writeToClob converted this to database standard characterset. xmldom.writeToFile didn't!

with function xmldom.setCharSet i converted xml-document to WE8ISO8859P1, and now it works!

unfortunately WE8ISO8859P15 seems to be not supported, so i can't use € euro currency symbol.

so far,
marrec
Previous Topic: Parsing DTD with Oracle XML Parser
Next Topic: XML - CLOB - CharacterSet Problem
Goto Forum:
  


Current Time: Mon Nov 25 10:41:47 CST 2024