selecting xml data [message #91846] |
Tue, 15 April 2003 00:54 |
shreevatsa
Messages: 1 Registered: April 2003
|
Junior Member |
|
|
Hi All,
I am newbie to XMLDB. I was working with sample programs available on otn.
I executed the scripts given below.
create table po_tab(
id number,
po sys.XMLType
)
xmltype column po
XMLSCHEMA "http://www.oracle.com/PO.xsd"
element "PurchaseOrder";
insert into po_tab values (1,
xmltype(’<PurchaseOrder xmlns="http://www.oracle.com/PO.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.oracle.com/PO.xsd
http://www.oracle.com/PO.xsd">
<PONum>1001</PONum>
<Company>Oracle Corp</Company>
<Item>
<Part>9i Doc Set</Part>
<Price>2550</Price>
</Item>
<Item>
<Part>8i Doc Set</Part>
<Price>350</Price>
</Item>
</PurchaseOrder>’));
I have registered the schema successfully.
Now while working with SQL Plus i tried the following stmts:
(1)select existsnode(po, '/PurchaseOrder/Item') from po_tab; THIS RETURNS A VALUE 0.
(2)select existsnode(po, '/PurchaseOrder') from po_tab; THIS RETURNS A VALUE 1.
What is the problem here with the XPATH expression in (1)? Whenever am trying to check the existence of child elements it fails...
Without this basic test, i cannot proceed to verify the function of Extract(), ExtractValue() etc.
Appreciate replies from esteemed users...
regards
vatsa
|
|
|