how to select certain xml group based on attribute id and return as xmltype
653831Mar 10 2011 — edited Mar 10 2011hi,
i have an xmltype column name "NM" in table "XMLTEST", the content of the xml in NM is
<ct>
<sp id="ALEX">
<sp id="JOHN">
<sp id="MIKE">
<sp id="CALEB"/>
<sp id="PAUL"/>
</sp>
</sp>
<sp id="MAX">
<sp id="WAYNE"/>
</sp>
<sp id="MAX"/>
</sp>
</ct>
The group i want to select is ALEX except group "MIKE" and "MAX", which return
<ct>
<sp id="ALEX">
<sp id="JOHN"/>
<sp id="SEAN"/>
</sp>
</ct>
Is it possible? i'm processing this using stored procedure PL/SQL, my environment is 11g R2 Win 32bit.
please advice,
wesley