我需要父节点属性的值
<Cases>
<Case tag="IT653294" requesting="IT" >
<Races>
<Race scheduled="2018-06-01" id="100"/>
</Races>
</Case>
<Case tag="IT831787" requesting="AB">
<Races>
<Race scheduled="2018-06-02" id="101" />
</Races>
</Case>
<Cases>
SELECT
FROM xml xx
,XMLTABLE (XMLNAMESPACES (DEFAULT 'http://www.my.nl/hello') ,
'for $i in Cases/Case/Races/Race return $i'
PASSING xx.XMLDOC
COLUMNS scheduled Date PATH '@scheduled'
id NUMBER PATH '@id' ) x
这给出了:
2018-06-01 100 2018-06-02 101
我需要的是:
SELECT
FROM xml gxml
,XMLTABLE (XMLNAMESPACES (DEFAULT 'http://www.my.nl/hello') ,
'for $i in Cases/Case/Races/Race return $i'
PASSING gxml.XMLDOC
COLUMNS scheduled Date PATH '@scheduled'
id NUMBER PATH '@id'
tag varchar2(20) PATH ?? ) x
2018-06-01 100 IT653294 2018-06-02 101 IT831787
所以,我需要父母的标签值。有什么想法可以做到这一点吗?
谢谢大家的帮助