I want to extract only leaf nodes from an XMLTYPE object in Oracle 10g
SELECT
t.getStringVal() AS text
FROM
TABLE( XMLSequence(
XMLTYPE(
'<xml>
<node>
<one>text</one>
</node>
<node>
<two>text</two>
</node>
<node>
<three>text</three>
</node>
</xml>'
).extract( '//*' )
) ) t
What should be used as a WHERE clause, so that it returns only the following values:
<one>text</one>
<two>text</two>
<three>text</three>
I tried the following, but they do not work:
WHERE t.existsNode( '//*' ) = 0
WHERE t.existsNode( '/.//*' ) = 0
WHERE t.existsNode( './/*' ) = 0
What am I missing?
source
share