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

Re: RE: Javascript quote escaping xx = (' ... \' ... '

Subject: Re: RE: Javascript quote escaping xx = (' ... \' ... ')
From: Maciek Adwent <maciekadwent@xxxxxxxxx>
Date: Wed, 31 Aug 2005 10:36:45 -0400
javascript quote
I've been trying to figure out a way to do this too by just using the
translate() function, but it doesn't work out for me. What I would
like to do is be able to simply go

var x = '<xsl:value-of select="translate($mystring, '\'', '\\\'')" />';

Or something similar -- the idea being that you would do it in just
one line. My current solution is a template that is ugly to call. Any
ideas anyone? I think the only way is to write a long template, which
kinda [expletive deleted] if you want to avoid using one for such a simple
transformation.


On 6/1/05, Bovy, Stephen J <STEPHEN.Bovy@xxxxxx> wrote:
> I need to imbed some xsl ouput within a
> JavaScript string literal assignment statement, for example:
>
> txt += '<xsl:value-of select="." />'
>
> Is there a way to configure my xsl style sheet to automatically
>
> convert single quote occurances to javascript escape format :
>
> (')  to --> (\') ???????
>
>



--
Maciej Adwent (maciekadwent@xxxxxxxxx)

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.