【发布时间】:2015-11-04 18:40:06
【问题描述】:
感谢您在这方面的帮助..
我有一个 XML 字符串包含在一个 XMLType 中,我试图从中提取一个值。基于大量在线研究,我已经花了很长时间,但没有成功...
l_resp_xml (xmltype) 中保存的字符串是:
<ns1:validateAccountResponse
xmlns:ns1="https://ws.hyphen.co.za/accountvalidation2">
<return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="tns:WebService_AccountValidation_Response">
<reference xsi:type="xsd:string">TLPM165U2876100975</reference>
<branchCode xsi:type="xsd:string">187646</branchCode>
<bankName xsi:type="xsd:string">NED:NEDBANK LTD RSA</bankName>
<branchName xsi:type="xsd:string">NEDBANK BRITS</branchName>
<accountNumber xsi:type="xsd:string">00000002876100975</accountNumber>
<accountType xsi:type="xsd:string">2</accountType>
<errorCode xsi:type="xsd:string">0</errorCode>
<resultCode xsi:type="xsd:string">0000</resultCode>
<resultMessage xsi:type="xsd:string"/>
<checkSum xsi:type="xsd:string">db8d375002ca1e62ab4e8696c480df12d7e10293a29ba1a0dc99868d18 aa2c7e</checkSum>
</return></ns1:validateAccountResponse>
我尝试了很多不同的方法来获取 bankName 的值。最新的很简单:
SELECT
EXTRACTVALUE(l_resp_xml, '/return/bankName')
into l_bank_name
FROM DUAL;
我尝试了很多变体,但无法从 bankName 获取值(l_bank_name 的内容始终为空白。如果有人可以提供帮助,我将不胜感激
非常感谢 理查德
【问题讨论】: