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

RE: Replacing double quotes with XSLT [faked-from][sls

Subject: RE: Replacing double quotes with XSLT [faked-from][sls]
From: Mischa Sandberg <MSandberg@xxxxxxxxxxxx>
Date: Mon, 22 Sep 2003 14:11:34 -0700
javascript replace double quotes
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@xxxxxxxxxxxxxxxxxxxxxx
Sent: 22/09/2003 1:35 PM
Subject:  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,'&#x22','&#x22&#x22'"/>
	<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


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.