Skip to Main Content

Database Software

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!

xmlelement do not escape special characters

user448703Sep 7 2005 — edited Sep 8 2005
Hi,

I have a query like this
select xmlelement("tagname",col1) from table1;

col1 is a varchar2 col and contains values like 'tom & jerry'.

By default the above query escapes the ampersand with "&followed by amp;". Is there any way to change this default behavior.

I want my tag as "<tagname> tom & jerry </tagname>"
instead of "<tagname> tom "&followed by amp;" jerry </tagname>".

I know we can use setsuppress* function in dbms_xmlgen package.
Is there any other way to do it in a sql query.

I was not able to escape ampersands in the above post. sorry about that.
thanks

Message was edited by:
user448703
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 6 2005
Added on Sep 7 2005
3 comments
2,035 views