dbTalk Databases Forums  

XML help

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss XML help in the comp.databases.oracle.misc forum.



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

Default XML help - 02-06-2009 , 08:53 AM








I'm in a bit of a pickle with an XML problem I'm having and I can't seem to
find any sensible answers anywhere.

Below is a sample of the XML that I have to work with. (I filtered out some
of the fields, the Items actually have about 30 elements.

I need to split this into 3 tables relationally. ORDER table, PACKAGE
table, ADDRESS table and PACKAGE_ITEMS table. I'm having a hard time
figuring out how to load this in sensibly. I have no real experience with
XML, or Java, however I'm painted into a corner here having to load this in.
I thought about just looping through the XML file and pulling out the keys,
but I've a feeling that there's something better out there. If you could
provide any leads or advice I'd be HUGELY appreciative and perhaps even name
my first child after you.

Thanks in advance.

<?xml version="1.0" standalone='yes'?>
<Order>
<orderReference/>
<orderNumber>2222</orderNumber>
<orderUserNumber>333</orderUserNumber>
<comments/>
<packages>
<package>
<packageIndex/>
<packageWarehouse/>
<packageWeight/>
<packageShippingMethod>standard</packageShippingMethod>
<packageCarrierMethod/>
<address>
<firstName>John </firstName>
<middleName/>
<lastName>Doe</lastName>
</address>
<items>
<item>
<itemSku>123456</itemSku>
<itemQuantity>1</itemQuantity>
</item>
<item>
<itemSku>123456</itemSku>
<itemQuantity>1</itemQuantity>
</item>
</items>
<packagePaymentStatus/>
<packagePaidAmount>0</packagePaidAmount>
</package>
</packages>
<extendedFields/>
</vendaOrder>



Reply With Quote
  #2  
Old   
Mark D Powell
 
Posts: n/a

Default Re: XML help - 02-06-2009 , 09:19 AM






On Feb 6, 9:53*am, "NavEEd" <naveed... (AT) hotmail (DOT) com> wrote:
Quote:
I'm in a bit of a pickle with an XML problem I'm having and I can't seem to
find any sensible answers anywhere.

Below is a sample of the XML that I have to work with. *(I filtered outsome
of the fields, the Items actually have about 30 elements.

I need to split this into 3 tables relationally. *ORDER table, PACKAGE
table, ADDRESS table and PACKAGE_ITEMS table. *I'm having a hard time
figuring out how to load this in sensibly. *I have no real experience with
XML, or Java, however I'm painted into a corner here having to load this in.
I thought about just looping through the XML file and pulling out the keys,
but I've a feeling that there's something better out there. *If you could
provide any leads or advice I'd be HUGELY appreciative and perhaps even name
my first child after you.

Thanks in advance.

?xml version="1.0" standalone='yes'?
Order
* <orderReference/
* <orderNumber>2222</orderNumber
* <orderUserNumber>333</orderUserNumber
* <comments/
* <packages
* * <package
* * * <packageIndex/
* * * <packageWarehouse/
* * * <packageWeight/
* * * <packageShippingMethod>standard</packageShippingMethod
* * * <packageCarrierMethod/
* * * <address
* * * * <firstName>John </firstName
* * * * <middleName/
* * * * <lastName>Doe</lastName
* * * </address
* * * <items
* * * * <item
* * * * * <itemSku>123456</itemSku
* * * * * <itemQuantity>1</itemQuantity
* * * * </item
* * * * <item
* * * * * <itemSku>123456</itemSku
* * * * * <itemQuantity>1</itemQuantity
* * * * </item
* * * </items
* * * <packagePaymentStatus/
* * * <packagePaidAmount>0</packagePaidAmount
* * </package
* </packages
* <extendedFields/
/vendaOrder

What version of Oracle? Oracle provides, depending on release,
several XML related handing features.

Try looking into dbms_xmlparser, dbms_xmlstore, etc ...

For version 9.2 see Supplied PL/SQL Packages and Type manual on 10g
see PL/SQL Packages and Type manual. Manual name varies slightly by
release.

HTH -- Mark D Powell --


Reply With Quote
  #3  
Old   
NavEEd
 
Posts: n/a

Default Re: XML help - 02-06-2009 , 12:46 PM



Hey Mark, thanks for the response.

I'm using 11g.


"Mark D Powell" <Mark.Powell (AT) eds (DOT) com> wrote

On Feb 6, 9:53 am, "NavEEd" <naveed... (AT) hotmail (DOT) com> wrote:
Quote:
I'm in a bit of a pickle with an XML problem I'm having and I can't seem
to
find any sensible answers anywhere.

Below is a sample of the XML that I have to work with. (I filtered out
some
of the fields, the Items actually have about 30 elements.

I need to split this into 3 tables relationally. ORDER table, PACKAGE
table, ADDRESS table and PACKAGE_ITEMS table. I'm having a hard time
figuring out how to load this in sensibly. I have no real experience with
XML, or Java, however I'm painted into a corner here having to load this
in.
I thought about just looping through the XML file and pulling out the
keys,
but I've a feeling that there's something better out there. If you could
provide any leads or advice I'd be HUGELY appreciative and perhaps even
name
my first child after you.

Thanks in advance.

?xml version="1.0" standalone='yes'?
Order
orderReference/
orderNumber>2222</orderNumber
orderUserNumber>333</orderUserNumber
comments/
packages
package
packageIndex/
packageWarehouse/
packageWeight/
packageShippingMethod>standard</packageShippingMethod
packageCarrierMethod/
address
firstName>John </firstName
middleName/
lastName>Doe</lastName
/address
items
item
itemSku>123456</itemSku
itemQuantity>1</itemQuantity
/item
item
itemSku>123456</itemSku
itemQuantity>1</itemQuantity
/item
/items
packagePaymentStatus/
packagePaidAmount>0</packagePaidAmount
/package
/packages
extendedFields/
/vendaOrder

What version of Oracle? Oracle provides, depending on release,
several XML related handing features.

Try looking into dbms_xmlparser, dbms_xmlstore, etc ...

For version 9.2 see Supplied PL/SQL Packages and Type manual on 10g
see PL/SQL Packages and Type manual. Manual name varies slightly by
release.

HTH -- Mark D Powell --



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.