I have below xml string which is mentioned below:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:ser="http://service.soap.CDRator.com" xmlns:xsd="http://data.soap.CDRator.com/xsd"
xmlns:xsd1="http://core.data.soap.CDRator.com/xsd" xmlns:xsd2="http://core.result.service.soap.CDRator.com/xsd">
<soap:Body>
<ser:generateArchiveDocument>
<!--Optional:-->
<ser:contextUser>
<!--Optional:-->
<xsd:brandKey>QAMSP</xsd:brandKey>
</ser:contextUser>
<!--Optional:-->
<ser:subscription>
<!--Optional:-->
<xsd1:id>201505261213407749</xsd1:id>
</ser:subscription>
<!--Optional:-->
<ser:letterKey>POS_CONTRACT_PRIVATE</ser:letterKey>
</ser:generateArchiveDocument>
</soap:Body>
</soap:Envelope>
I have written below select query to get the value from string <xsd1:id>201505261213407749</xsd1:id> and <ser:letterKey>POS_CONTRACT_PRIVATE</ser:letterKey>. I want to get the value from this string but the query return nothing.
Here is my select query:
SELECT ID,xt_req.SUBSCRIPTION_ID,CREATE_DATE,WEB_SERVICE_NAME,WEB_METHOD_NAME
FROM TEMP_SOAP_GENERATE_CONTRACT sm
CROSS JOIN XMLTable(XMLNAMESPACES (
'http://www.w3.org/2003/05/soap-envelope' AS "xsd1"
),
'for $i in //xsd1:id return $i'
passing XMLType(sm.REQUEST_XML)
columns "SUBSCRIPTION_ID" number path '/') xt_req
CROSS JOIN XMLTable(XMLNAMESPACES (
'http://www.w3.org/2003/05/soap-envelope' AS "ser"
),
'for $i in ser:letterKey return $i'
passing XMLType(sm.REQUEST_XML)
columns "LETTER_KEY" VARCHAR2(1000) path '/') xt_letterkey;