Skip to Main Content

SQL & PL/SQL

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!

Get position of xml-tag in clob

Jan LeersJan 16 2013 — edited Jan 17 2013
Hi,

Is it possible to get the offset in a clob, representing an xml, by using xml functionality? (function or xmltable)

For example, with a clob:
  v_clob := '<a><b  type="1">val1</b><b type="2">val2</b></a>';
I would like a function like:
  v_offset := xml_offset(v_clob,'/a/b[@type="2"]');
With a result of 24 to get the tag, or 35 when asking for the actual value.

Thanks,
Jan

Edited by: BluShadow on 16-Jan-2013 15:22
added {noformat}
{noformat} tags for readability.  Please see {message:id=9360002} and learn to do this yourself in future.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 14 2013
Added on Jan 16 2013
12 comments
1,453 views