I need the value of a parent node attribute
<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
this gives :
2018-06-01 100 2018-06-02 101
what I need is :
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
so, i Need the tag value from the parent. Any ideas how to accomplish this?
Thanks you all for your help