dbTalk Databases Forums  

Parse xml document in Oracle 9i.

comp.database.oracle comp.database.oracle


Discuss Parse xml document in Oracle 9i. in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Miguel Lienlaff
 
Posts: n/a

Default Parse xml document in Oracle 9i. - 02-19-2004 , 03:29 PM






Dear Oracle Community

Could you help me ???? !!!

I have to parse different xml documents and
save them in a set of tables in Oracle 9i.

A person told me that oracle is able to do that through
a mapping between xml and tables.

Do you now how to do it ?

Thanks in Advance

Miguel Lienlaff

Reply With Quote
  #2  
Old   
IgorB
 
Posts: n/a

Default Re: Parse xml document in Oracle 9i. - 02-26-2004 , 08:46 AM






mlienlaff (AT) sii (DOT) cl (Miguel Lienlaff) wrote in message news:<daba365c.0402191329.55d13e0a (AT) posting (DOT) google.com>...
Quote:
Dear Oracle Community

Could you help me ???? !!!

I have to parse different xml documents and
save them in a set of tables in Oracle 9i.

A person told me that oracle is able to do that through
a mapping between xml and tables.

Do you now how to do it ?

Thanks in Advance

Miguel Lienlaff
Hi!
Suppose your have your XML in CLOB variable,
than,

create table myxml
( x SYS.XMLTYPE )


declare
xml CLOB; -- contains XML
xmlt sys.XMLTYPE;
begin
xmlt := sys.XMLType.createXML(xml);
insert into myxml values (xmlt);
...

than you can work with this XML, stored in the database by means of
XMLDOM support in ORACLE:


declare
xmlt sys.XMLTYPE;
clob_xml CLOB;
parser XMLPARSER.Parser := XMLPARSER.NewParser;
sourceXML XMLDOM.DOMDocument;
begin
select xx into xmlt
from myxml;

clob_xml := xmlt.getClobVal();
xmlparser.setValidationMode(parser,FALSE);
XMLPARSER.ParseCLOB(parser, clob_xml);
sourceXML := XMLPARSER.GetDocument(parser);
...



Best regards, Igor Balakirev


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.