[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Using translate() for single quotes in XSL1.0

Subject: Using translate() for single quotes in XSL1.0
From: "Oleg Konovalov" <olegkon@xxxxxxxxx>
Date: Fri, 25 Aug 2006 16:11:51 -0400
sql translate
Hi,

I am writing an XSL Transformer for SQL query and some
of the column values ("ASSOCIATION_NAME")  in DB might have a single
quote in the name,
which poses a problem in SQL.

Example:

<xsl:text>  ...
(SELECT association_id
FROM ASSOCIATION
WHERE association_name='</xsl:text>
<xsl:value-of select='$row/sht:Cell[sht:Name="ASSOCIATION_NAME"]/sht:Content'/><xsl:text>'
) )</xsl:text>...

like: "MACY'S"
So I tried to use to replace 1 single quote in the column values with
2 single quotes
which SQL should resolve using translate(value, "'", "''").
But there is such a mishmash of quotes and double quotes that it's
impossible to resolve:
...
<xsl:value-of select='translate(
$row/sht:Cell[sht:Name="ASSOCIATION_NAME"]/sht:Content, '"", "'''")'/>

Any way around it, maybe via ASCII of single quotes ?


Thank you in advance, Oleg.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.