Using DBMS_XMLDOM to insert into table [message #198722] |
Wed, 18 October 2006 06:10 |
macspark
Messages: 1 Registered: October 2006
|
Junior Member |
|
|
Hi All
First off appologies if this post is in the wrong forum. Maybe it should be in the 'JDeveloper, Java and XML' forum?
I'm running Oracle 9.0.1.1.0
I have read so much documentation in the last couple of days that I'm even more confused than when I started! I am trying to process a simple xml file and place the contents into a simple 1 column table using the DBMS_XMLDOM package.
XML file -
<?xml version="1.0" encoding="UTF-8"?>
<article lang="en-US">
<para>Story</para>
<para>Russias Energy Policy Nash or Nichego</para>
<para>The Kremlin has changed the rules of the game and the rest of the developed world has been slow in catching up.</para>
<para>However, the explosion of demand caused by the sudden economic ascendancy of China and India and the appearance of an oil sector integrated with the global market in the former Soviet block has changed the rules of the game completely.</para>
<para>On the one hand, Europe is attempting to liberalise its energy sector in an effort to give market forces the lead in setting prices and determining delivery schedules. The US is trying to diversify its suppliers to free itself from becoming a political hostage to any one region.</para>
<para>bla bla bla</para>
<para>bla bla bla</para>
</article>
I know the xml is not well structured but that's all I have to work with!
I have successfully parsed the xml file and have an xmldom.domdocument. Essentially what I want to do is go through all the para elements and insert each value into a table TEMP_ARCHIVE_IMPORT ( import_data varchar2(4000));
So that select * from TEMP_ARCHIVE_IMPORT returns
-Story
-Russias Energy Policy Nash or Nichego
-The Kremlin has changed the rules of the game and the rest of the developed world has been slow in catching up.
-However, the explosion of demand caused by the sudden economic ascendancy of China and India and the appearance of an oil sector integrated with the global market in the former Soviet block has changed the rules of the game completely.
-On the one hand, Europe is attempting to liberalise its energy sector in an effort to give market forces the lead in setting prices and determining delivery schedules. The US is trying to diversify its suppliers to free itself from becoming a political hostage to any one region.
-bla bla bla
-bla bla bla
Any ideas?
|
|
|