This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Query regarding XSL variables
- From: Matt Gushee <mgushee at havenrock dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 11 Apr 2002 22:36:44 -0600
- Subject: Re: [xsl] Query regarding XSL variables
- References: <scb6a2d9.017@bombay.imrglobal.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
On Fri, Apr 12, 2002 at 09:03:00AM +0530, Anand Ganapathy wrote:
> I want to pass xsl:variables to a javascript function.How is it possible to achieve the same?
This is a job for Attribute Value Templates (AVTs). Normally, you can't
use a variable reference or XPath expression in an attribute of a literal
result element, because it is interpreted as a literal string. But if you
wrap it in curly braces -- {$my_variable} -- then it is evaluated as an
expression. You can also use AVTs in a few XSLT elements; I never
remember which ones--but you should be able to look it up in any good
XSLT book.
So, in your example:
> <A href="javascript:" onClick="({$nodeaddr1},{$lidentifier1},{$nodename1});"> <xsl:value-of select="Nodename"/> </A>
should do what you want.
--
Matt Gushee
Englewood, Colorado, USA
mgushee@havenrock.com
http://www.havenrock.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list