以下は、SOAP サービスの応答です。Pl/SQLで値を抽出するにはどうすればよいですか..私が試したいくつかの方法をリストしました
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<ShipmentTrackingResponse xmlns="http://ws.aramex.net/ShippingAPI/v1/">
<Transaction xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Reference1>001</Reference1>
<Reference2 i:nil="true"/>
<Reference3 i:nil="true"/>
<Reference4 i:nil="true"/>
<Reference5 i:nil="true"/>
</Transaction>
<Notifications xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>
<HasErrors>false</HasErrors>
<TrackingResults xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:KeyValueOfstringArrayOfTrackingResultmFAkxlpY>
<a:Key>4738079651</a:Key>
<a:Value>
<TrackingResult>
<WaybillNumber>4738079651</WaybillNumber>
<UpdateCode>SH247</UpdateCode>
<UpdateDescription>Supporting Document Returned to Shipper</UpdateDescription>
<UpdateDateTime>2013-07-15T19:29:00</UpdateDateTime>
<UpdateLocation>Mumbai,India</UpdateLocation>
<Comments/>
<ProblemCode/>
</TrackingResult>
<TrackingResult>
<WaybillNumber>4738079651</WaybillNumber>
<UpdateCode>SH369</UpdateCode>
<UpdateDescription>SMS Sent to Consignee</UpdateDescription>
<UpdateDateTime>2013-07-12T09:10:00</UpdateDateTime>
<UpdateLocation>Mumbai,India</UpdateLocation>
<Comments/>
<ProblemCode/>
</TrackingResult>
<TrackingResult>
<WaybillNumber>4738079651</WaybillNumber>
<UpdateCode>SH033</UpdateCode>
<UpdateDescription>Attempted Delivery - Payment Declined by Customer</UpdateDescription>
<UpdateDateTime>2013-07-11T17:20:00</UpdateDateTime>
<UpdateLocation>Goa Branch-GOI,India</UpdateLocation>
<Comments/>
<ProblemCode>A18</ProblemCode>
</TrackingResult>
<TrackingResult>
<WaybillNumber>4738079651</WaybillNumber>
<UpdateCode>SH369</UpdateCode>
<UpdateDescription>SMS Sent to Consignee</UpdateDescription>
<UpdateDateTime>2013-07-11T10:36:00</UpdateDateTime>
<UpdateLocation>Mumbai,India</UpdateLocation>
<Comments/>
<ProblemCode/>
</TrackingResult>
<TrackingResult>
<WaybillNumber>4738079651</WaybillNumber>
<UpdateCode>SH003</UpdateCode>
<UpdateDescription>Out for Delivery</UpdateDescription>
<UpdateDateTime>2013-07-11T10:19:00</UpdateDateTime>
<UpdateLocation>Goa Branch-GOI,India</UpdateLocation>
<Comments/>
<ProblemCode/>
</TrackingResult>
<TrackingResult>
<WaybillNumber>4738079651</WaybillNumber>
<UpdateCode>SH203</UpdateCode>
<UpdateDescription>Record Created</UpdateDescription>
<UpdateDateTime>2013-07-05T00:39:00</UpdateDateTime>
<UpdateLocation>Nehru Place Branch,India</UpdateLocation>
<Comments/>
<ProblemCode/>
</TrackingResult>
</a:Value>
</a:KeyValueOfstringArrayOfTrackingResultmFAkxlpY>
</TrackingResults>
<NonExistingWaybills xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/></ShipmentTrackingResponse></s:Body>
</s: Envelope>
値を抽出するにはどうすればよいですか、文字通り立ち往生しています。あらゆる方法を試しました。いくつかの方法は次のとおりです。
l_resp_xml := XMLType.createXML(l_clob_response);
SELECT EXTRACT(l_resp_xml, '//ShipmentTrackingResponse/TrackingResults',
'xmlns="http://ws.aramex.net/ShippingAPI/v1/"') INTO l_resp_xml FROM dual;
そして最後に値を抽出します。しかし、役に立ちません! 助けてください!!
SELECT EXTRACTVALUE(l_resp_xml,
'//TrackingResults/a:KeyValueOfstringArrayOfTrackingResultmFAkxlpY/a:Value/TrackingResult[1]/UpdateDescription', 'xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"')INTO l_response_result FROM dual;
DBMS_OUTPUT.put_line ( 'Result> l_response_clobExtract=' || l_response_result);
XmlTable の使用方法