XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
sue depaSubject: Mapping XML to Oracle
Author: sue depa
Date: 28 Jul 2005 06:08 PM
Hi All,

I need to map the xml file data to Oracle. Right now I am using the below PL/SQL to map the below xml element info.

XML element info:
<Carrier>
<OrganizationId>INTL</OrganizationId>
<OrganizationName>Integra Logistics LLC</OrganizationName>
</Carrier>

PL/SQL Code:

ELSIF LOWER(node_name)=LOWER('ORGANIZATIONID') THEN
m:=xmldom.getParentNode(m);
node_name:=xmldom.getNodeName(m);
dbms_output.put_line(' the parent node is: '||node_name);
m:=xmldom.getParentNode(m);
node_name:=xmldom.getNodeName(m);
dbms_output.put_line(' the parent node is: '||node_name);
IF LOWER(node_name)=LOWER('CARRIER') THEN
INSERT INTO CARRIER(recordnum,organizationid,code) VALUES
(rownumber,nodevalue,'shipment_status_214');

ELSIF LOWER(node_name)=LOWER('CarrierSCAC') THEN
INSERT INTO CARRIER(recordnum,scac_id,code) VALUES
(rownumber,nodevalue,'shipment_status_214');


ELSIF LOWER(node_name)=LOWER('ORGANIZATIONNAME') THEN
m:=xmldom.getParentNode(m);
node_name:=xmldom.getNodeName(m);
dbms_output.put_line(' the parent node is: '||node_name);
m:=xmldom.getParentNode(m);
node_name:=xmldom.getNodeName(m);
dbms_output.put_line(' the parent node is: '||node_name);
IF LOWER(node_name)=LOWER('CARRIER') THEN
INSERT INTO CARRIER(recordnum,organizationname,code) VALUES
(rownumber,nodevalue,'shipment_status_214');

ELSIF LOWER(node_name)=LOWER('CarrierSCAC') THEN
INSERT INTO CARRIER(recordnum,scac_name,code) VALUES
(rownumber,nodevalue,'shipment_status_214');
ELSE
dbms_output.put_line('unreferenced attribute ' || attrname || ' = ' || attrval);
Fnd_File.put_line(Fnd_File.LOG,'unreferenced attribute ' || attrname || ' = ' || attrval);
END IF;


And Now there is change in the XML Element above as follows:

<Carrier>
<OrganizationId type="SCAC">INTL</OrganizationId>
<OrganizationName>Integra Logistics LLC</OrganizationName>
</Carrier>


My program gives me error for this element saying Unreferenced element in attribute .... Please help me to map this info.

Thanks,
Sue

Postnext
Tony LavinioSubject: Mapping XML to Oracle
Author: Tony Lavinio
Date: 28 Jul 2005 08:22 PM
First, since this is really an Oracle issue and has little to do
with Stylus, you'd probably get a better answer on an Oracle support
forum.

But, you haven't shown all of the code (as indicated by the PL/SQL
program starting with ELSIF), and the error message you quoted,
"Unreferenced element in attribute" seems to be emitted from part of
the code that you _haven't_ posted. So it's hard to diagnose the
problem from what you've given.

Can you attach the whole procedure?

(And if you do post attachments, try using the checkbox above the
message text that says "Attach File" which will make it easier for us
to read.)

Postnext
sue depaSubject: Mapping XML to Oracle
Author: sue depa
Date: 29 Jul 2005 10:23 AM
Hi Tony,

Attached the Procedure.

Thanks,
sue.



UnknownPRP_DOMSAMPLE_214.PRC
Procedure

Postnext
Tony LavinioSubject: Mapping XML to Oracle
Author: Tony Lavinio
Date: 29 Jul 2005 11:28 AM
First, bear in mind that I haven't written PL/SQL within the past
few years, and haven't tested this, but it appears that the problem
is straight-forward to solve.

At line 78, right before the 'else', insert these lines

elsif lower(node_name)=lower('type') then
NULL;

this will cause it to skip the newly added 'type=' attribute
and hopefully will solve the problem.

Now, this is all assuming you don't care about the attribute
saying type="SCAC" in your input data.

Postnext
sue depaSubject: Mapping XML to Oracle
Author: sue depa
Date: 29 Jul 2005 01:03 PM
Tony,

Didn't work still same problem. Any other ideas...

Thanks,
Sue.

Posttop
Tony LavinioSubject: Mapping XML to Oracle
Author: Tony Lavinio
Date: 29 Jul 2005 04:10 PM
The only other idea I have is to ask this on an Oracle forum.
Sorry.

Although it doesn't have to do with Stylus Studio, we do try
to be helpful, but I don't have the resources to debug Oracle
problems.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.