Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> XML question?
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;
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