select data from xml content
Hi,
I have xmlcontent stored in a table as CLOB content with this format:
<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<ns1:searchByCommonNameGroupIdAndCim10IdsResponse xmlns:ns1="urn:Vidal">
<ns1:contraIndicationCim10List>
<contraIndications xmlns="urn:Vidal">
<contraIndicationTypeCim10Tuple>
<cim10>
<code>J11</code>
<id>3333</id>
<name />
</cim10>
<contraIndication>
<id>1111</id>
<name>some data written here</name>
</contraIndication>
<type>A</type>
</contraIndicationTypeCim10Tuple>
<contraIndicationTypeCim10Tuple>
<cim10>
<code>J11</code>
<id>3333</id>
<name />
</cim10>
<contraIndication>
<id>2222</id>
<name>some data written here</name>
</contraIndication>
<type>A</type>
</contraIndicationTypeCim10Tuple>
</contraIndications>
<homogeneous xmlns="urn:Vidal">true</homogeneous>
</ns1:contraIndicationCim10List>
</ns1:searchByCommonNameGroupIdAndCim10IdsResponse>
</soap:Body>
</soap:Envelope>
and I want to view th data as report (I need tha date id, code, name to view it in the report.)
I wrote the following query:
select EXTRACTVALUE(xmltype.createxml(clob001),'/soap:Envelope/soap:Body/ns1:searchByCommonNameGroupIdAndCim10IdsResponse/ns1:contraIndicationCim10List/contraIndications/contraIndicationTypeCim10Tuple/contraIndication/code','xmlns:ns1="urn:Vidal"') code
from wwv_flow_collections c
where c.collection_name = 'MY_COLLECION_NAME'
but I got the following error:
report error:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00601: Invalid token in: '/soap:Envelope/soap:Body/ns1:searchByCommonNameGroupIdAndCim10IdsResponse/ns1:contraIndicationCim10List/contraIndications/contraIndicationTypeCim10Tuple/contraIndication/code'
any idea about this please.
Regards.
Mohd.