Problem inserting XML doc (character set)
Hi all,
I'm having trouble trying to insert XML either "posting" it (xsql) or "putting" it
(OracleXML putXML).
The error that I get: "not supported
oracle-character-set-174".
The environment is:
Oracle 8i 8.1.5
(NLS_CHARACTERSET EL8MSWIN1253 for greek)
JDK 1.2.2
Apache Web Server 1.3.11
Apache JServ 1.1
XSQL v 0.9.9.1 and
XMLSQL, XML parser v2 that comes with it.
I had dropped all java classes and reloaded
them using oraclexmlsqlload batch file.
But still getting the same error.
The thing that is that I am
able to insert XML doc that was generated
with an authoring tool called W4F that extracts data from HTML pages and map them to
XML document, even with greek characters
in it. But when XML is generated using
an editor or the servlet like the following:
newschedule.xsql like
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="latestschedules.xsl"?>
<page connection="dtv" xmlns:xsql="urn:oracle-xsql">
<xsql:insert-request date-format="DD'/'MM'/'YYYY" table="schedule_details_view"
transform="request-to-newschedule.xsl"/>
<xsql:query table="schedule"
tag-case="lower" max-rows="5" rowset-element="latestschedules"
row-element="schedule">
select *
from schedules
order by schedule_id desc
</xsql:query>
</page>
request-to-newschedule.xsl like
<?xml version = '1.0'?>
<ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
<xsl:for-each select="request/parameters">
<ROW>
<SCHEDULE_ID><xsl:value-of select="Schedule_id_field"/></SCHEDULE_ID>
<DESCRIPTION><xsl:value-of select="Description_field"/></DESCRIPTION>
<DETAILS>
<DETAILS_ITEM>
<STARTING_TIME><xsl:value-of select="Starting_Time_field_1"/></STARTING_TIME>
<DURATION><xsl:value-of select="Duration_field_1"/></DURATION>
</DETAILS_ITEM>
<DETAILS_ITEM>
<STARTING_TIME><xsl:value-of select="Starting_Time_field_2"/></STARTING_TIME>
<DURATION><xsl:value-of select="Duration_field_2"/></DURATION>
</DETAILS_ITEM>
<DETAILS_ITEM>
<STARTING_TIME><xsl:value-of select="Starting_Time_field_3"/></STARTING_TIME>
<DURATION><xsl:value-of select="Duration_field_3"/></DURATION>
</DETAILS_ITEM>
<DETAILS_ITEM>
<STARTING_TIME><xsl:value-of select="Starting_Time_field_4"/></STARTING_TIME>
<DURATION><xsl:value-of select="Duration_field_4"/></DURATION>
</DETAILS_ITEM>
<DETAILS_ITEM>
<STARTING_TIME><xsl:value-of select="Starting_Time_field_5"/></STARTING_TIME>
<DURATION><xsl:value-of select="Duration_field_5"/></DURATION>
</DETAILS_ITEM>
</DETAILS>
</ROW>
</xsl:for-each>
</ROWSET>
Hope that someone could help me on this ...
Any advice is highly appreciated.
Thanks in advance
Nicos Gabrielides
email: [email protected]
Hi,
How about applying an XSL on the existing XML doc to create another XML doc to filter out the table column not found in the target db table, so that all the columns are matched and then use putXML to load?
Hope that helps.
OTN team@IDC
Similar Messages
-
Problem inserting xml doc into tables
I'm trying to load and xml doc into a table/columns using putXML. I clearly have elements in my xml doc that I do not want to load into the table. I am receiving the following error: The XML element tag 'VERB' does not match the name of any of the columns/attributes of the target database. I'm having difficulty figuring out how to exclude of ignore these elements.
Any help would be greatly appreciated.
Thanks,
JohnHi,
How about applying an XSL on the existing XML doc to create another XML doc to filter out the table column not found in the target db table, so that all the columns are matched and then use putXML to load?
Hope that helps.
OTN team@IDC -
Any jdbc examples inserting XML doc
Newbie to xmldb/jdbc/java
I'm looking for some sample java code that uses jdbc to insert xml docs into the 10g xml db.
Also looking for sample code that does xquery using JDBC on 10g xmldb.
(using eclipse on windows)
any help appreciatedDoes this help, assume that you have an instance of
public XMLType makeXMLType(OracleConnection conn,Document xmlDocument)
throws NamingException
try {
XMLType xml = null;
if (xmlDocument != null)
xml = XMLType.createXML(conn,xmlDocument);
return xml;
catch (SQLException sqle)
NamingException ne = new NamingException(SQLCache.UNEXPECTED_SQL_EXCEPTION);
ne.setRootCause(sqle);
throw ne;
You can then bind the XMLType to an insert statement using setObject. -
Problem with XML doc inserting into oracle 10g
Hi Guys, I have some knowledge in oracle 10g.
We are doing an application, when we were trying to insert XML document (I was trying to insert XML as un-structured way.) into oracle 10g as a datatype called XMLTYPE column.
My XML is having namespace attributes(Target namespaces) in that. So when i was trying to insert that into database , it is giving some error ,and not letting me to push that into database.
So Can any body please help me in this. My constraint is that I have to insert the document as un-structured way.
You help would be appriciated.
Vish
Message was edited by:
user567405
Message was edited by:
user567405
Message was edited by:
user567405
Message was edited by:
user567405
Message was edited by:
user567405, it is giving some error Hmmm, six attempts and you still didn't manage to tell us what the actuall error message and number was. Oracle has thousands of error messages. If you would like us to help you, make it easy for us to figure out what's going on. Don't make us guess.
Regards, APC -
PL/SQL XML generation: Character set issues
Hi,
I am using the PL/SQL DOM (wrappers to the Java DOM), to generate XML from bits of database information. (On Oracle 8i).
The output XML must be in UTF-8, and the database character set must be anything I want it to be. So I call
setCharset(doc, 'UTF8')
at the beginning, and I call
writeToClob(doc, xmllob, 'UTF8')
at the end, just to cover all eventualities.
However, any character outside ASCII gets
replaced with the character string "\xBF\xBF", which is rather tedious.
If, instead, we go via
writeToBuffer(doc, xmlbuf, 'UTF8')
and then dump the buffer contents into a clob, the UTF8 encoding is preserved, and everything works.
(This latter method is not good enough for my needs; I need more than 32K of data...)
So I was wondering if any kind soul could tell me what I am doing wrong.
Thanks,
<< Mike Alexander >>
nullI have the same problem. Is there any solution found?
only xslprocessor.valueOf returns values of xml document not loosing special symbols. -
Problems with LPX-00245 (character set problem?)
Hi all,
I've got a problam with ORA-19202 and LPX-00245 (extra data after end of document) when querying my xmltype table. The table contains one large xml document. This xml document is valid, I've checked it against the corresponding XSD (using JDeveloper and also Notepad++, no validation errors).
I gues it has something to do with the encoding of the document. The original encoding is ISO-8859-1 (<?xml version="1.0" encoding="ISO-8859-1"?>). When I load the document to the database it is autoamtically changed to UTF-8 (<?xml version="1.0" encoding="UTF-8"?>) maybe because the character setting of my database is AL32UTF8.
I use the following statement to store my XML:
insert into my_table
values( my_seq_spp.nextval,
r_get_files.file_name,
xmltype(
bfilename(p_directory, r_get_files.file_name) -- p_directory is the name of an oracle dircetory
, nls_charset_id('WE8ISO8859P1')
Nevertheless the retrieved charset id 31 is ignored. Also if II use csid = 0, it doesn't work...
Any idea how to enforce using ISO-8859-1 instead UTF-8 as character set?
Best regards
MatthiasHi Marco,
I don't think it has anything to do with encoding (client-side or not).
I'd be more inclined to say it's related to XML fragments manipulation.
@Matthias :
Does this work better :
select m.version
, sp.Betriebsstelle
, spa.Betriebsstellenfahrwege
from imp_spurplan t
, xmltable('/XmlIssDaten'
passing t.xml_document
COLUMNS
Version varchar2(6) path 'Version/Name'
, Spurplanbetriebsstellen xmltype path 'Spurplanbetriebsstellen'
) m
, xmltable('/Spurplanbetriebsstellen/Spurplanbetriebsstelle'
passing m.Spurplanbetriebsstellen
COLUMNS
Betriebsstellenfahrwege_xml xmltype path 'Betriebsstellenfahrwege'
, Betriebsstelle varchar2(6) path 'Betriebsstelle'
) sp
, xmltable('/Betriebsstellenfahrwege'
passing sp.Betriebsstellenfahrwege_xml
COLUMNS
Betriebsstellenfahrwege xmltype path '.'
) spa
where sp.Betriebsstelle = 'NWH' -
Hey all.
Bit of an interesting problem me thinks. I'm in building a
multilingual multiple choice CBT CD. I'm using XML to store the
test questions to allow for easy updates. The problem I'm having is
when I'm trying to import the XML into director using the XML
parser and it's a Cyrillic language (Russian, etc) It comes out all
wrong.
I've tried a few different ways to get it to work and I've
not been able to crack it. The XML file has the correct Unicode,
I've got a CYR font being used and still nothing.
Anyone have any ideas as to the best way to go about using
XML with Cyrillic Character sets?
Cheers
ColAFAIK, Director doesn't support unicode : try loading &
displaying your
xml data with a flash animation embedded in you dir movie
hth
Ned -
Problem inserting XML into object view
Hi all,
My environment is :
Windows NT 4.0
Oracle 8i 8.1.5
(NLS_CHARACTERSET = EL8MSWIN1253)
Apache 1.3.11 Web Server
Apache JServ 1.1
XSQL v 0.9.9.1 and XML parser for Java v2,
XMLSQL that come with it
I've created an object view as following :
create table schedules (
schedule_id varchar2(20),
description varchar2(100),
constraint pk_schedule_id primary key (schedule_id)
create table schedule_details (
schedule_id varchar2(20),
starting_time date,
duration number,
constraint pk_schedule_dtls primary key (schedule_id, starting_time),
constraint fk_schedule_id foreign key (schedule_id) references schedules (schedule_id)
create or replace type schedule_detail_t as object (
starting_time varchar2(20),
duration number
create or replace type schedule_detail_list as table of schedule_detail_t;
create or replace type schedule_details_t as object (
schedule_id varchar2(20),
description varchar2(100),
details schedule_detail_list
create or replace view schedule_details_view of schedule_details_t
with object OID (schedule_id)
as select schedule_id, description,
cast(multiset(select schedule_detail_t (to_char(starting_time, 'hh24:mi'), duration) as Detail
from schedule_details
where schedule_details.schedule_id = schedules.schedule_id
) as schedule_detail_list )
from schedules;
And I'm trying to insert using putXML this
<?xml version = "1.0" encoding = "ISO-8859-1"?>
<ROWSET>
<ROW>
<SCHEDULE_ID>S1112</SCHEDULE_ID>
<DESCRIPTION>Working 08:00 to 20:00</DESCRIPTION>
<DETAILS>
<DETAILS_ITEM>
<STARTING_TIME>08:00</STARTING_TIME>
<DURATION>12</DURATION>
</DETAILS_ITEM>
</DETAILS>
</ROW>
</ROWSET>
The error I get is
oracle.xml.sql.OracleSQLXMLException:
non supported oracle-character-set-174
Note: no rows have been inserted
at oracle.xml.sql.dml.OracleXMLSave.insertXML
When I'm posting using XSQL the XML doesn't get inserted with no error message.
But when I try this for a change
<?xml version = "1.0" encoding = "ISO-8859-1"?>
<ROWSET>
<ROW>
<SCHEDULE_ID>S1111</SCHEDULE_ID>
<DESCRIPTION>Working 08:00 to 20:00</DESCRIPTION>
</ROW>
</ROWSET>
Trying to insert into table (this time) "schedules" using putXML it works ...
It works on tables and it doesn't work on object views.
Any piece of advice will be highly appreciated.
NickNo known limitations. Please post the sample DDL to create your object types and object view, along with an example of the example XML document you're trying to insert.
-
Insert Chinese Data(Character Set
Can any Chinese DBA tell me how to store chinese data in Oracle 8.1.5.0.0 Database.
I tried the combination of UTF8 database character set with UTF8 national character set and UTF8 database character set with ZHS16MACCGB231280 national character set. A column in a table was defined as nchar/nvarchar2. But when I tried to insert chinese data into the column using insert into... command, I always got the error message 'Character Set Mismatch'.Originally NCHAR was defined for a few selective fixed with Aisan character sets. In 9i it was redefined to support unicode. For 8.1.5 you will need to store your Chinese data in char, varchar, and CLOB data types.
-
Still problems serializing xml-docs with xml-parser for java v2.0.2.7
Hi !
I'm using the Oracle XML Parser 2.0.2.7.0 and get some problems when serializing the XMLDocument.
In one class (DOMOut) I parse a xml-file with the oracle.xml.parser.v2.DOMParser, then obtain the XMLDocument and write it to System.out
In another class (DOMIn) I fetch the XMLDocument from System.in, search for a given Element and print it's TextValue (if existing) to System.out
That is where the error occurs.
I get the XMLDocument from System.in but the returning NodeList from doc.getElementsByTagName() is empty. [nl.getLength()==0] even if it shouldn't be.
Look at this code and output:
[DOMOut]
DOMParser parser = new DOMParser();
parser.parse(url);
XMLDocument doc = (XMLDocument)parser.getDocument();
ObjectOutputStream out = new ObjectOutputStream(System.out);
out.writeObject(doc); out.flush();
[DOMIn]
ObjectInputStream in = new ObjectInputStream(System.in);
XMLDocument doc = (XMLDocument)in.readObject();
doc.print(System.out);
NodeList nl = doc.getElementsByTagName("Name");
System.out.println("Length of NodeList: "+nl.getLength());
if (nl.getLength()==0)
System.out.println(argv[0] + ": not in this document!");
else {
XMLNode node = (XMLNode) nl.item(nl.getLength()-1);
System.out.println(node.getNodeName() + ": " + (node.getFirstChild()).getNodeValue());
This is the relevant code.
I javac both classes and then do this:
java DOMOut xmltestfile.xml > xx
java DOMIn Name < xx
And get this as output:
<?xml version = '1.0'?>
<!DOCTYPE course [
<!ELEMENT course (Name,Dept,Instructor,Student)>
<!ELEMENT Name ((#PCDATA)*)*>
<!ELEMENT Dept ((#PCDATA)*)*>
<!ELEMENT Instructor (Name)>
<!ELEMENT Student (Name)*>
]>
<course>
<Name>Calculus</Name>
<Dept>Math</Dept>
<Instructor>
<Name>Jim Green</Name>
</Instructor>
<Student>
<Name>Jack</Name>
<Name>Mary</Name>
<Name>Paul</Name>
</Student>
</course>
Length of NodeList: 0
Name: not in this document!
Has anyone an idea?
If I do all this stuff without serializing it works.
If I do not search for argv[0], but the string "Name" it fails.
If I do search for "*" it works fine!
I'm very confused could anybody please help me a bit??
Stefan.
[[email protected]]The link has been fixed. You will go to the v2 download page
now. Sorry for the inconvience.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
Renilton Oliveira (guest) wrote:
: I didn't find the file for version 2.0.0.0 as well.
: Renilton
: Andrei Filimonov (guest) wrote:
: : I tried to download XML Parser for Java v2 it seems that
only
: v
: : 1.0.1.4 is available. Could you please give an exact URL for
: v2
: : download?
: : Andrei Filimonov
: : Oracle XML Team wrote:
: : : The Oracle XML v2 parser is now available for download
here
: as
: : : an early beta release and is written in Java. It features
: an
: : : improved architecture over the Oracle XML v1 parser and
has
: : : shown better performance on small to large XML documents.
: It
: : : will also be able to format the XML document according to
a
: : : stylesheet, having integrated an XSLT processor.
: : : Version 2 of the XML Parser for Java, besides
incorporating
: an
: : : XSLT processor, has been re-architected from version 1.
This
: : has
: : : resulted in a number of changes to the class names
: especially
: : : those that support Namespaces. See v2changes.txt and
: the .diff
: : : difference files in the sample directory.
: : : Oracle XML Team
: : : http://technet.oracle.com
: : : Oracle Technology Network
null -
Problem insert XML from ViewObject to Clob
i write method insertXML() and have problem write to CLOB.
public void insertXML(){
ViewObject vo=getZlecenieView1();
Row r = vo.getCurrentRow();
Object t= vo.writeXML(1,XMLInterface.XML_OPT_ALL_ROWS);
String xml=t.toString();
r.setAttribute("Xml",new ClobDomain(xml));
getDBTransaction().commit();
system.out.println(xml) oracle.xml.parser.v2.XMLElement@196c67a
I'cant cast to String vo.wirteXML(1,XMLInteface.XML_OPT_ALL_ROWS);
how write method???I would suggest printing out the contents of the input as you receive them in the JSP.
PS, your architecture smells. What's with the ActiveX objects? What's with putting all you business logic in JSPs? -
Hi Sergiusz, it looks like you are a character set guru. Maybe you would know how to solve my problem? I've got a working application under oracle xe, apache and embedded listener. I would like to switch to a new APEX listener with tomcat but there is a problem with a foreign character set. Existing pages with such characters are displayed correctly but if I type them in into an input filed they are not showing up correctly on the next page. This is done without even saving information in a database. I type in text in one field which is a source of an item on another page. These are character settings in my database.
SQL> select value from nls_database_parameters where parameter = 'NLS_CHARACTERSET';
VALUE
AL32UTF8
SQL> select value from nls_database_parameters where parameter = 'NLS_NCHAR_CHARACTERSET';
VALUE
AL16UTF16
Thanks,
ArtHi Sergiusz, thank you for your help. After setting a URIEncoding to UTF-8 and some further research I was able to fix my problem. Here is the entire solution in case someone else needs it.
1.) Change $CATALINA_HOME/conf/server.xml and add
URIEncoding=UTF-8
<Connector port="8090" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"/>
2.) Copy $CATALINA_HOME/webapps/examples/WEB-INF/classes/filters/SetCharacterEncoding.class => $CATALINA_HOME/webapps/apex/WEB-INF/classes/filters
3.) Add the following into $CATALINA_HOME/webapps/apex/WEB-INF/web.xml file after the last </servlet-mapping> tag.
<filter>
<filter-name>Set Character Encoding</filter-name>
<filter-class>filters.SetCharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Set Character Encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Thanks,
Art -
Character set Conversion problem
Hello
I have a problem in converting AL32UTF8 character set to AR8MSWIN1256 ,We have two databases in linux suppose
db1 and db2 , I have a procedure in db2 that connect to db1 by a database link and extract records from a table
in db1 database and save them in a file , at this process I user CONVERT function for converting AL32UTF8 characters to AR8MSWIN1256 but when I open that file by any editor in Microsoft Windows it show me unreadable characters,I must mention that the table has Farsi (Persion) characters and Persion characters are unreadable
in db1 database NLS_CHARACTERSET=AL32UTF8 and NLS_NCHAR_CHARACTERSET=AL16UTF16
in db2 database NLS_CHARACTERSET=AL32UTF8 and NLS_NCHAR_CHARACTERSET=UTF8
db1 is oracle10 and db2 is oracle9i
the table structure is like it
CREATE TABLE "ALI"."STMP"
( "P_EXCHANGECODETRADER" VARCHAR2(8),
"P_NEGOUSLOGIN" VARCHAR2(40),
"I_BIC_CODE" VARCHAR2(11),
"P_NEGOLIBELLE" VARCHAR2(60),
"DAT" DATE DEFAULT trunc(sysdate),
"SEQ" NUMBER(15,0),
"OPERATION" CHAR(1))
and the procedure is :
create or replace procedure khosravi.traders_changes_file2(code_page varchar2:='AR8MSWIN1256')
as
ft UTL_FILE.FILE_TYPE;
head varchar2(3000 );
line varchar2(3000 );
tail varchar2(3000 );
temp char(3000 char);
c_date date;
counter pls_integer:=0;
function repeat_char(inp char,repeat pls_integer) return varchar2
as
res varchar2(2000 char):='';
begin
if (LENGTH(inp)*repeat) > 2000 then
raise_application_error(-20101, 'the length is bigger than 2000');
end if;
for i in 1..repeat loop
res:=res || inp;
end loop;
return(res);
end repeat_char;
begin
c_date:=sysdate;
head:='01' || 'DEALER' || repeat_char(' ',18) ||to_char(c_date,'YYYYMMDD')||
to_char(c_date,'hh24miss') ;
temp:=head;
ft:=UTL_FILE.fopen(location => 'TEST_DIR',filename => 'ali_'||code_page,open_mode => 'w',max_linesize => 3000);
UTL_FILE.PUT_LINE(file => ft,buffer =>convert(trim(temp),code_page) );
for rec in (select city,p_exchangecodetrader,p_negouslogin,i_bic_code,p_negolibelle,dat,operation from traders_changes@db1) loop
line:='12' || 'DEALER' || repeat_char(' ',18) ||to_char(c_date,'YYYYMMDD')|| to_char(c_date,'hh24miss')
|| rec.p_exchangecodetrader || repeat_char(' ',8-length(rec.p_exchangecodetrader))
|| rec.p_negolibelle || repeat_char(' ',50-length(rec.p_negolibelle))
|| substr(rec.p_exchangecodetrader,1,3) || ' '
|| substr(rec.p_exchangecodetrader,1,3) || ' '
|| substr(rec.p_exchangecodetrader,6,3)
|| rec.i_bic_code || repeat_char(' ',11-length(rec.i_bic_code))
|| substr(rec.p_negouslogin,1,8)
|| repeat_char(' ',14)
|| 'I'
|| repeat_char(' ',4)
|| repeat_char(' ',10)
|| ' '
||' '
||' '
|| repeat_char(' ',40)
|| repeat_char(' ',40)
|| repeat_char(' ',40)
|| repeat_char(' ',5)
|| rec.city || repeat_char(' ',40-length(rec.city))
|| repeat_char(' ',28)
|| repeat_char(' ',15)
|| repeat_char(' ',15)
|| repeat_char(' ',10)
|| rec.operation
temp:=line;
UTL_FILE.PUT_LINE(file => ft,buffer =>convert(trim(temp),code_page) );
counter:=counter+1;
end loop;
for rec in (select city,p_exchangecodetrader,p_negouslogin,i_bic_code,p_negolibelle,dat,operation from traders_changes@db1) loop
line:='13' || 'DEALER' || repeat_char(' ',18) ||to_char(c_date,'YYYYMMDD')|| to_char(c_date,'hh24miss')
|| rec.p_exchangecodetrader || repeat_char(' ',8-length(rec.p_exchangecodetrader))
|| substr(rec.p_exchangecodetrader,1,3) || ' '
|| substr(rec.p_exchangecodetrader,1,3) || ' '
|| substr(rec.p_exchangecodetrader,6,3)
|| repeat_char(' ',151)
temp:=line;
UTL_FILE.PUT_LINE(file => ft,buffer =>convert(trim(temp),code_page) );
counter:=counter+1;
end loop;
counter:=counter+2;
tail:='99'||'DEALER' || repeat_char(' ',18)
|| to_char(c_date,'YYYYMMDD')
|| to_char(c_date,'hh24miss')
|| repeat_char('0',9-length(to_char(counter)))
|| to_char(counter);
temp:=tail;
UTL_FILE.PUT_LINE(file => ft,buffer =>convert(trim(temp),code_page) );
UTL_FILE.fclose(ft);
end;
Do you know what is problem or do you know better solution ?
Thankshttp://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions027.htm#SQLRF00620 might be of some help
Take a look at oracle clients you are connecting from too (I'm not experienced as I don't have privileges to do anything regarding the operating system)
Regards
Etbin -
Oracle xml_dom.writeToClob ignore the character set
I'm trying to generate a xml file using oracle. After generating the xml using dbms_xmldom, it is stored in a CLOB and later written to a table.
The problem is that the character set ('UTF-8') is not included in the header even though it is specified using setCharset() procedure.
Following is the oracle script,
declare
export_file_ CLOB ;
str_export_file_ xmldom.DOMDocument;
main_node xmldom.DOMNode;
root_node xmldom.DOMNode;
root_elmt xmldom.DOMElement;
begin
str_export_file_ := xmldom.newDOMDocument;
xmldom.setVersion(str_export_file_, '1.0');
xmldom.setCharset(str_export_file_ , 'UTF-8');
main_node := xmldom.makeNode(str_export_file_);
root_elmt := xmldom.createElement(str_export_file_,'TextTranslation');
xmldom.setAttribute( root_elmt, 'version' ,'1.0');
xmldom.setAttribute( root_elmt, 'language' ,'ja');
xmldom.setAttribute( root_elmt, 'module' ,'DEMOAND');
xmldom.setAttribute( root_elmt, 'type' ,'VC');
root_node := xmldom.appendChild(main_node, xmldom.makeNode(root_elmt));
export_file_ :=' ';
xmldom.writeToClob( str_export_file_,export_file_,'UTF-8');
dbms_output.put_line ( export_file_ );
end;
The output is ,
<?xml version="1.0"?>
<TextTranslation version="1.0" language="ja" module="DEMOAND" type="VC"/>
If anybody can suggest me what I have done incorrectly that will be great.
Thanks in advance.The character set you specify via setCharset() procedure is ignored unless you use writeToFile() later.
http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_xmldom.htm#CHDCGDDB
Usage Notes
This is used for WRITETOFILE Procedures if not explicitly specified at that time.You can also use something like this :
SQL> set serveroutput on
SQL>
SQL> declare
2
3 export_file clob;
4 prolog clob := '<?xml version="1.0" encoding="UTF-8"?>';
5
6 begin
7
8 select prolog || chr(10) ||
9 xmlserialize(document
10 xmlelement("TextTranslation"
11 , xmlattributes(
12 '1.0' as "version"
13 , 'ja' as "language"
14 , 'DEMOAND' as "module"
15 , 'VC' as "type"
16 )
17 )
18 indent
19 )
20 into export_file
21 from dual ;
22
23 dbms_output.put_line ( export_file );
24
25 end;
26 /
<?xml version="1.0" encoding="UTF-8"?>
<TextTranslation version="1.0" language="ja" module="DEMOAND" type="VC"/>
PL/SQL procedure successfully completed -
10g XE WebDav does not load XML doc
Hi,
I am experimenting with XE XMLDB. I have successfully registered a simple schema and was able to insert XML doc from sqlplus into XML DB. But when I drop a XML doc into the WebDav folder, the document did not get loaded. My 10g XE is installed on my laptop running Win XP, and I have both ftp (2100) and http (8080) ports actived. everything is local in my laptop.
I had no problem at all when (doing the same testing) dropping the the doc into another WebDAV folder, which points to the XML DB on an ora92 EE installation running on a UNIX server.
Don't know What i have missed?The following command will also do the trick without bouncing your database:
alter system register;
Maybe you are looking for
-
How to find open SO Items with tax code for a particular day?
Dear all If i want to see all open SOs(items), with tax code for a particular day, how to find using table VBAP in SE16? Please guide me Edited by: Julius Bussche on Mar 3, 2009 11:10 PM Please use descriptive subject titles and the search
-
Can I reimage an external hard drive that is in the windows NT file format?
can I reimage an external hard drive that is in the windows NT file format?
-
I am on a Macbook (laptop) operating with Mac OSX 10.6.8. I am using WIFI to sign on and have no trouble opening Safari yet every time I try to open firefox I get hit with the 'server can't be found error message. Oddly, all the bookmarks still work
-
dear friends i Have a peculiar problem in my company , only for materials which are one in quantity , if after 601 we are doing sales return 653 then materials which were in one quantity there MAP becomes zero and in 653 movement in mb5b there map is
-
Providing users the ability to Merge using a DAT file under Windows 7
Hello, Our organization uses older software that uses Word Templates with Merge Fields, pulling data out of a SQL database. The software itself is old and out of date, but still works under Windows 7. The problem I am having is that the software wi