如何从XML中提取值,如果我这样做,我就会收到错误'element-start标签格式不正确'

时间:2016-10-11 13:43:56

标签: sql xml soap oracle11g

由于我是这个概念的新手,我已经浏览了谷歌的所有资源,但没有找到如何提取值。

下面是我的xml搁浅格式,客户端将xml作为请求发送。

通过提取值,我必须将其作为参数传递给过程。

这是我用于从XML中提取值的SQL查询...

SELECT
   XMLTYPE(l_request).EXTRACT('//txtBranchCode/text()').getStringVal()
FROM
   dual ;

和XML是:

l_request:='<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
            <soap:Body>
            <ns2:fundTransferAccountToMobile xmlns:ns2="http://deploy.fasyl.xnett.com/">
            <txtUserId>SUCHITH</txtUserId>
            <txtPassword>pass</txtPassword>
            <txtBankName>GCB</txtBankName>
            <txtBranchCode>A00</txtBranchCode>
            <txtAccountNumber>A001041111220100042</txtAccountNumber>
            <txtBFName>test</txtBFName>
            <txtBLName>test</txtBLName>
            <txtAmount>15.0</txtAmount>
            <txtCurrency>GHS</txtCurrency>
            <txtRefID>1</txtRefID>
            <mydate>2016-07-1308:01:48.014</mydate>
            <txtCountryCode>233</txtCountryCode>
            <txtAuthNum>9743699236</txtAuthNum>
            <txtExternal1>null</txtExternal1>
            <txtExternal2>null</txtExternal2>
            </ns2:fundTransferAccountToMobile>
            </soap:Body>
            </soap:Envelope>';

Say for exp我必须提取txtBranchCode的值,我正在使用上面的查询,我收到错误“element-start tag not not formed”...

请在此帮助我...

0 个答案:

没有答案