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!

Any way to generate a single quote (') with XSLT?

GaffMar 31 2009 — edited Apr 1 2009
Hi:

I guess this is really an XSLT question. I'm using the Transform() method of an XMLType variable to apply a style sheet. The XML in the variable is just something simple like

<TBL>
<LAST_NAME>LIKE|JONES</LAST_NAME>
<FIRST_NAME>=|MARY</FIRST_NAME>
<AGE>=|50</AGE>
</TBL>

I am trying to get a stylesheet to transform something like the above into SQL such as
Select * from foo where LAST_NAME like 'JONES' 
and FIRST_NAME ='MARY'
and AGE = 50
But to do this, I need to generate the single quotes around the search terms and I can't get anything but
LAST_NAME LIKE &apos;JONES&apos;
. Is there a way to do this? For now I am generating a ~ and replacing ~ for ' throughout the generated SQL text but that's a pretty sorry solution.

I thought that something like
<xsl:text disable-output-escaping="yes">&amp;</xsl:text>
was going to work but then found out it has been deprecated. I was thinking character-map might work but that's an XSLT 2.0 thing and apparently 10g is on XSLT 1.0? In any case, it had no idea what I was trying to do with a character map.

So, am I overlooking an obvious way to get my stylesheet to insert apostrophes?

Thanks.
This post has been answered by Jason_(A_Non) on Mar 31 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2009
Added on Mar 31 2009
10 comments
6,203 views