Home » Developer & Programmer » JDeveloper, Java & XML » XML Parsing....need some info
XML Parsing....need some info [message #388528] Wed, 25 February 2009 03:57 Go to next message
rak007
Messages: 107
Registered: October 2006
Location: Mumbai / Pune, India
Senior Member
I have the following requirements

1. Will be getting a XSD and XML file. Need to validate this XML against the corresponding XSD.

2. Parse the XML file and fetch the data to be inserted into a few custom tables.

3. All this is to be done using PL SQL.


Sorry for very high level requirements...but any pointers to this will be highly appreciated.

Database version is 9i

[Updated on: Wed, 25 February 2009 04:54]

Report message to a moderator

Re: XML Parsing....need some info [message #388534 is a reply to message #388528] Wed, 25 February 2009 04:20 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
You can use an XML-schema to define a set of XML-tables. Validating incoming XMLs is done automagically, as well as storing them in these XML-tables.
This is a good way to go if you want the data as XML; if you want it as relational data later on, I'm not sure about it. Last time I worked with it, was years ago, with previous db-versions.
Probably enhanced drastically since.

Back then it was called XDB or XML DB, if you need search terms.
Re: XML Parsing....need some info [message #388538 is a reply to message #388534] Wed, 25 February 2009 05:00 Go to previous messageGo to next message
trivendra
Messages: 211
Registered: October 2007
Location: Phoenix
Senior Member
Almost 95% of the requirements match with my previous project, but want to know about registering XSD. Will it be done on table level or JSF class.
Re: XML Parsing....need some info [message #388552 is a reply to message #388528] Wed, 25 February 2009 06:38 Go to previous messageGo to next message
rak007
Messages: 107
Registered: October 2006
Location: Mumbai / Pune, India
Senior Member
we would refrain from using java

Our DB version is 9i and someone suggested that we will not be able to use EXTRACTVALUE(VALUE to extract the values for various tags and attributes.
They said that it is only for 10G and above. But we will be able to use XMLTYPE to validate XML against XSD (we dont know how to do that).

According to our DB version which would be the most apt way to accomplish our task ??
Re: XML Parsing....need some info [message #388555 is a reply to message #388552] Wed, 25 February 2009 06:50 Go to previous message
trivendra
Messages: 211
Registered: October 2007
Location: Phoenix
Senior Member
You can use you EXTRACTVALUE() function to extract Values from XML. This doc shows the usage in 9i.

http://www.oracle-base.com/articles/9i/XMLDB9i.php

And register you XSD on XML type table, but be sure that is correct because you cannot change the XSD. You need to drop and recreate again.

Thanks
Trivendra
Previous Topic: JNDI exeception
Next Topic: Java, PL/SQL Proc
Goto Forum:
  


Current Time: Thu Mar 28 12:23:54 CDT 2024