Hi all,
From this XML :
<execute-transaction app-ref="SRSRSimpleMult" app-sn="458" login="CARNI">
<context key="Env:LOGIN" value="CARNI"/>
<context key="Env:APP_SN" value="458"/>
<context key="Env:APP_REF" value="SRSRSimpleMult"/>
</execute-transaction>
I would like to extract all the "key" attribute...
The following select returns the good result but all is in 1 row :
select extract(XMLTYPE('<execute-transaction app-ref="SRSRSimpleMult" app-sn="458" login="CARNI">
<context key="Env:LOGIN" value="CARNI"/>
<context key="Env:APP_SN" value="458"/>
<context key="Env:APP_REF" value="SRSRSimpleMult"/>
</execute-transaction>'),'*/context/@key') FROM DUAL;
So I use XMLSequence (and not XMLTable because I'm still on Oracle 10g1) but the following select returns nothing
select COLUMN_VALUE FROM table(xmlsequence(extract(XMLTYPE('<execute-transaction app-ref="SRSRSimpleMult" app-sn="458" login="CARNI">
<context key="Env:LOGIN" value="CARNI"/>
<context key="Env:APP_SN" value="458"/>
<context key="Env:APP_REF" value="SRSRSimpleMult"/>
</execute-transaction>'),'*/context/@key')));
However if I simply remove the "@key" in the XPath expression, the select gives me back a good result ! (but with the context tag that I don't care)
Can someone tell me why the SELECT doesn't return a result when the xpath expression contains the "@key" attribute ?
Thx