xsl-list
[Top] [All Lists]

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

2005-08-31 07:36:45
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 sucks if you want to avoid using one for such a simple
transformation.


On 6/1/05, Bovy, Stephen J <STEPHEN(_dot_)Bovy(_at_)ca(_dot_)com> 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 --> (\') ???????

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





-- 
Maciej Adwent (maciekadwent(_at_)gmail(_dot_)com)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>