oracle xml-从多个相似节点获取节点值

问题描述

这是xml,当类型='testAmount'和货币='INR'时,我想获取1234567

...整个xml太大,无法粘贴重要的

<testxml:testNotification>
        <testxml:callAmount>
          <testxml:money>
            <testxml:type>testAmount</testxml:type>
            <testxml:amount currency="USD">2127150</testxml:amount>
          </testxml:money>
          <testxml:money>
            <testxml:type>testAmount</testxml:type>
            <testxml:amount currency="INR">1234567</testxml:amount>----------------this one
          </testxml:money>
          <testxml:money>
            <testxml:type>testDCAmount</testxml:type>
            <testxml:amount currency="USD">2127150</testxml:amount>
          </testxml:money>
          <testxml:money>
            <testxml:type>testDCAmount</testxml:type>
            <testxml:amount currency="INR">1800099</testxml:amount>
          </testxml:money>
        </testxml:callAmount>
</testxml:testNotification>

...

我的尝试:

select x_identifier,mcb.* 
FROM mcb
LEFT JOIN XMLTABLE(xmlnamespaces('http://testsystem.tst.test.net/testxmlpt-2-0' as "testxml"),'/testxml:testxmltestCollNot/testxml:Collateral/testxml:testMcall' PASSING mcb.OUTGOING_XML 
 COLUMNS x_identifier          VARCHAR2( 300 ) PATH 'testxml:testNotification/testxml:callAmount/testxml:money/testxml:type/text()'
) X_mcb ON 1 = 1 
              ;

我当前的输出: testAmounttestAmounttestDCAmounttestDCAmount

必需的输出: 1234567

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)