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

Re: Query regarding XSL variables

Subject: Re: Query regarding XSL variables
From: "KUMAR NINGASHETTY" <kningashetty@xxxxxxxxxxxxxxxx>
Date: Fri, 12 Apr 2002 10:03:53 -0400
javascript selectnode
Anand,
  passing variables that way should have worked ...
  anyways try the following ...

Haven't tested though ...

<xsl:template match="Node1">
   ........

 <A href="javascript:" onClick="selectNode('{Nodeddress}','{Levelidentifier}','{Nodename}')"> </A>

   .......

</xsl:template>

-Kumar


>>> Anand.Ganapathy@xxxxxx 04/12/02 04:19AM >>>
Hi Matt,
I tried the approach suggested by you, but the javascript function can't recognize the same and alerts that it can't recognize nodeAddress1.Please help.
Regards,
Anand
>>> Matt Gushee <mgushee@xxxxxxxxxxxxx> 04/12/02 10:06AM >>>
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@xxxxxxxxxxxxx 
http://www.havenrock.com/ 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list 



 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.