Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Using Xpath with Node Names with Colons (:)

509419Apr 13 2007 — edited Apr 17 2007
Hi,

I'm attempting to retrieve the contents of "soapenv:Envelope" from the following xml:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/X
MLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<responseTime soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns="https://adwords.google.com/api/adwords/v8">86</responseTime>
<operations soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns="https://adwords.google.com/api/adwords/v8">1</operations>
<units soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns="https://adwords.google.com/api/adwords/v8">1</units>
<requestId soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns="https://adwords.google.com/api/adwords/v8">d0bbb12ab9f3bd0523140b19767ef5dc</requestId>
</soapenv:Header>
</soapenv:Envelope>

I've tried using :

select extractValue(xml_data, '/soapenv:Envelope/@*') from XMLTable;

(assuming that xml_data is of type xmlType)

and receive the error:
ERROR at line 1:
ORA-31013: Invalid XPATH expression

However, if use the following:

select extract(xml_data, '//*[starts-with(name(),"soapenv:E")from XMLTable;

I get:

EXTRACT(XML_DATA,'//*[STARTS-WITH(NAME(),"SOAPENV:E")]')
--------------------------------------------------------------------------------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmln

What gives...? How can I use the former query instead of the latter...?

Thanks...!

J

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 15 2007
Added on Apr 13 2007
2 comments
727 views