Try this SQL on both 9i and 10g:
Select Value(P) EachProduct
From Table(XMLSequence(XMLTYPE('<?xml version="1.0" encoding="utf-16"?>'||
'<myTestXML xmlns="http://www.myTestXML.com">'||
' <Product>'||
' <ID>P001</ID>'||
' <Description>Test 001</Description>'||
' <Price>12.00</Price>'||
' </Product>'||
' <Product>'||
' <ID>P002</ID>'||
' <Description>Test 002</Description>'||
' <Price>13.00</Price>'||
' </Product>'||
'</myTestXML>').Extract('//Product', 'xmlns="http://www.myTestXML.com"'))) P;
And check the results (just posting the first row):
9i:
<Product>
<ID>P001</ID>
<Description>Test 001</Description>
<Price>12.00</Price>
</Product>
10g:
<Product xmlns="http://www.myTestXML.com">
<ID>P001</ID>
<Description>Test 001</Description>
<Price>12.00</Price>
</Product>
Love coding!
No comments:
Post a Comment