Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to select certain xml group based on attribute id and return as xmltype

653831Mar 10 2011 — edited Mar 10 2011
hi,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 7 2011
Added on Mar 10 2011
2 comments
225 views