Ah yes, this one. It comes up whenever you use XSLT to generate SQL; and
I'll wager that's your problem, too. Your choices:
- Write a template (procedure) that does it. Painfully slow performance. The
code has been posted in many places; e.g.
http://aspn.activestate.com/ASPN/Cookbook/XSLT/Recipe/65426
- use a script extension function (like msxml:) to use javascript's
REPLACE() method. MS-specific, and I think w3c is down on such extensions.
- do what we did: translate quote to an absurd character (take your pick)
and use SQL's replace() function internally.
- if you're NOT generating SQL, do a compiled pre- or post- process on the
text.
- wait until replace() is added to the standard.
-----Original Message-----
From: James Paul
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Sent: 22/09/2003 1:35 PM
Subject: [xsl] Replacing double quotes with XSLT [faked-from][sls]
I'm trying to replace " within a string in XSLT and replace it with ""
but I'm not having any luck.
Does NOT work
<xsl:element name = "OrganizationCode">
<xsl:text>"</xsl:text>
<xsl:value-of select =
"translate(../@OrganizationCode,'\"','\"\"'"/>
<xsl:text>"</xsl:text>
</xsl:element>
Does NOT work
<xsl:element name = "OrganizationCode">
<xsl:text>"</xsl:text>
<xsl:value-of select =
"translate(../@OrganizationCode,'"','""'"/>
<xsl:text>"</xsl:text>
</xsl:element>
Does anyone have any suggestions ???
Thanks
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list