Home » Developer & Programmer » JDeveloper, Java & XML » Loading and processing XML file at run time (10g XE, Windows)
Loading and processing XML file at run time [message #516302] Sat, 16 July 2011 06:15 Go to next message
piotrekxxxxxx
Messages: 1
Registered: August 2010
Junior Member
Hi, can anybody tell me if there is any package provided with DB that would allow me to import XML file and then use XPath to read the data? I need to insert it in proper tables then. I could see packages to create XML files, but I could not see any one to load it from the file. I could see it could be done in Java using XMLDOM, but is there any way of doing this using pure PL/SQL?
Re: Loading and processing XML file at run time [message #516306 is a reply to message #516302] Sat, 16 July 2011 08:34 Go to previous messageGo to next message
Solomon Yakobson
Messages: 1397
Registered: January 2010
Senior Member
It is not clear what type of processing are you looking for, but PL/SQL has DBMS_XMLDOM package and many others like DBMS_XMLGEN, DBMS_XMLPARSER, DBMS_XMLQUERY, DBMS_XDB, etc, a set of built in functions like XMLAGG, XMLCDATA, XMLCOLATTVAL, XMLCOMMENT, XMLCONCAT, XMLELEMENT, XMLFOREST, XMLPARSE, XMLPI, XMLQUERY, XMLROOT, XMLSEQUENCE, XMLSERIALIZE, XMLTABLE, XMLTRANSFORM, etc.

SY.
Re: Loading and processing XML file at run time [message #516307 is a reply to message #516302] Sat, 16 July 2011 09:21 Go to previous messageGo to next message
Michel Cadot
Messages: 54127
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
See these topics:
Read XML Files!
Insert xml into table in plsql!

Regards
Michel
Re: Loading and processing XML file at run time [message #522344 is a reply to message #516302] Thu, 08 September 2011 14:34 Go to previous messageGo to next message
msol25
Messages: 211
Registered: June 2011
Location: Mumbai
Senior Member
Yes,

You can do using XMLDOM Parser.But why u want to use XMLDOM Parser.Actually you no need to use DOM parser for Oracle10g version.You have inbuilt functionality for retrieving .xml values from given path i.e mentioned in .xsd using extractvalue function.Please find steps for using this function:

Step 1: Create table column as clob

Step 2: Use extractvalue function like :

select extractvalue( xmltype(clob_col),
'/ns:notify/bs:name/cs:value',
'xmlns:ns="http://xsd1"
xmlns:bs="http://xsd2"
xmlns:cs="http://xsd3"'
)
from dual;

Here location is : '/ns:notify/bs:name/cs:value'
and .xsd path in .xml is :

'xmlns:ns="http://xsd1"
xmlns:bs="http://xsd2"
xmlns:cs="http://xsd3"'


Yes you can use .xsd using xmldom but you have to use xsl stylesheet and need to hardcode your path.

Regards
Saurabh Mittal
Re: Loading and processing XML file at run time [message #522347 is a reply to message #522344] Thu, 08 September 2011 14:41 Go to previous message
Michel Cadot
Messages: 54127
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
You can do using XMLDOM Parser.But why u want to use XMLDOM Parser.

Once again you are out of topic.
OP said: " I could see it could be done in Java using XMLDOM, but is there any way of doing this using pure PL/SQL? "
So it does NOT want to do what you say.

In addition, if OP didn't come back since 2 months, I think he got his asnwer.

Regards
Michel
Previous Topic: Native Java in Oracle vs PL/SQL
Next Topic: add new multiple new rows
Goto Forum:
  


Current Time: Sun May 19 01:36:56 CDT 2013

Total time taken to generate the page: 0.11047 seconds