Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> XML question?

XML question?

From: M Hashim <m.a.n.hashim_at_sympatico.ca>
Date: Sun, 19 Jan 2003 01:20:20 -0800
Message-ID: <NkrW9.11830$0E.1512895@news20.bellglobal.com>


Oracle 8.1.7 on W2K

Processing an XML file.

Is there a way to get to the tag with the namespace in the xml. I can get there
if I remove the namespace and put an explicit tag, but that's not practical.

Load_XML calls load_c_Person and passes in the xmldom.domdocument.

SQL> exec Load_XML
BEGIN Load_XML; END;

*
ERROR at line 1:
ORA-20100: Error occurred while processing: Namespace prefix 'ccc' used but not
declared.

ORA-06512: at "SYS.XSLPROCESSOR", line 22
ORA-06512: at "SYS.XSLPROCESSOR", line 446
ORA-06512: at "u1.SELECTED_NODES", line 7
ORA-06512: at "u1.LOAD_C_PERSON", line 7
ORA-06512: at "u1.LOAD_XML", line 91
ORA-06512: at line 1



XML file:
<?xml version="1.0" encoding="UTF-8"?>
<ccc:xx xmlns:ccc="http://abc.com/xml-schemas/ccc" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"

xsi:schemaLocation="http://abc.com/xml-schemas/cccperson.xsd">
<PERSON>
<ID>28</ID>
<NAME>Smith/</NAME>
<COUNTRY>US</COUNTRY>
</PERSON>

</ccc:xx>

CREATE OR REPLACE PROCEDURE load_c_Person (doc_in IN xmldom.domdocument,

      v_Per_id  OUT      C_Person.id%TYPE) IS
      person_info xmldom.domnodelist;
      l_node  xmldom.domnode;
      person_rec C_person%ROWTYPE;

   BEGIN
 person_info := selected_nodes(doc_in, '/ccc:xx/PERSON');  l_node := xmldom.item (person_info, 0);
 person_rec.ID    :=xslprocessor.valueof (l_node, 'ID');
 person_rec.Name   :=xslprocessor.valueof (l_node, 'NAME');
 person_rec.COUNTRY   :=xslprocessor.valueof (l_node, 'COUNTRY');

 INSERT INTO C_PERSON (ID,COUNTRY)
 VALUES(person_rec.ID,person_rec.COUNTRY);

      v_Per_id := person_rec.ID;
END;
/

If I change the XML file to look like this, it works <?xml version="1.0" encoding="UTF-8"?>
<ccc>
<PERSON>
<ID>28</ID>
<NAME>Mark Twain</NAME>
<Country>239</Country>
</PERSON>

</ccc> Received on Sun Jan 19 2003 - 03:20:20 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US