This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Javascript in XSLT
- From: Mike Brown <mike at skew dot org>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Sun, 23 Jun 2002 19:03:56 -0600 (MDT)
- Subject: Re: [xsl] Javascript in XSLT
- Reply-to: xsl-list at lists dot mulberrytech dot com
Joel Konkle-Parker wrote:
> onmouseover="{concat('showMenu('menu', category_name,
> 'Drop')')}"
Wasn't I just getting embarrased about not remembering the use case for this a
couple weeks ago? Declare a variable that, when used as a string, will work
the way you want:
<xsl:variable name="q">'</xsl:variable>
Then stick it in your concat()...
onmouseover="{concat('showMenu(',$q,'menu',category_name,'Drop',$q,')')}"
No need to escape the parentheses, by the way. And you're right, XSLT is XML,
so it gets parsed first. ' is no better than a literal ', because by the
time it gets into XPath/XSLT land, it's an apostrophe either way, and XPath
doesn't have a mechanism for escaping them. Seems like they could've used
backslashes.. wonder why they didn't.
- Mike
____________________________________________________________________________
mike j. brown | xml/xslt: http://skew.org/xml/
denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list