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!

Unescape XML

189821Jan 7 2010 — edited Jan 7 2010
Hi folks,

this is my Oracle Version :-(
BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
PL/SQL Release 9.2.0.8.0 - Production
CORE    9.2.0.8.0       Production
TNS for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production
NLSRTL Version 9.2.0.8.0 - Production
If I have an XML document like
<ROWSET>
 <ROW>
  <TEXT>abc &#38;lt;def&#38;gt;</TEXT>
 </ROW>
</ROWSET>
I can retrieve the text element like
SQL>SELECT XMLType('<ROWSET><ROW><TEXT>abc &lt;def&gt;</TEXT></ROW></ROWSET>').extract('/ROWSET/ROW/TEXT/text()').getStringVal() AS x FROM DUAL;

X
--------------------------------------------------
abc &#38;lt;def&#38;gt;
but I need it like
X
--------------------------------------------------
abc &lt;def&gt;
Please help!
Urs
This post has been answered by ravikumar.sv on Jan 7 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2010
Added on Jan 7 2010
5 comments
1,905 views