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

Query regarding XSL variables

Subject: Query regarding XSL variables
From: "Anand Ganapathy" <Anand.Ganapathy@xxxxxx>
Date: Fri, 12 Apr 2002 09:03:00 +0530
href onclick xsl variable
Hello,

I am generating an html file from an XML using XSL in order to generate a tree display .

I want to pass xsl:variables to a javascript function.How is it possible to achieve the same?

This is  an example of the scenario I am talking about so that what I intend to do becomes clear:

  <xsl:variable name = "nodeaddr1">
      <xsl:value-of select = "(//Node1/Nodeaddress) "/> 
 </xsl:variable>

<xsl:variable name = "lidentifier1">
      <xsl:value-of select = "(//Node1/Levelidentifier) "/>
</xsl:variable>

<xsl:variable name = "nodename1">
      <xsl:value-of select = "(//Node1/Nodename) "/>
</xsl:variable>
<TR class="DARK">
               <TD>
               <A class="hier" href="javascript:">
                  <img src="images\treePics\downarrow.gif" border="0" />  
	       </A> &#160;
	       <A href="javascript:" onClick="( var1,var2,var2);"> <xsl:value-of select="Nodename"/> </A>
            </TD>
    </TR>

I want var1,var2 and var3 being passed as the xsl variables declared above.
I  tried passing $nodeaddr1,$lidentifier1 and $nodename1 but those are unrecognized in the html.

Also tried passing them as:
<A href="javascript:" onClick="selectNode( <xsl:value-of select = "(//Node1/Nodeaddress)"/>, <xsl:value-of select = "(//Node1/Levelidentifier)) "/>, <xsl:value-of select = "(//Node1/Nodename) "/>);"></A>

But I get the following error:
Message: Server caught unhandled exception from servlet [jsp11]: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: The value of attribute "onClick" must not contain the '<' character.

Please help.

Thanks in Advance,

Anand.




 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.