This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: How can I use a variable out of it scope ?
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] How can I use a variable out of it scope ?
- From: "frank Stein" <freeposte at hotmail dot com>
- Date: Wed, 31 Jan 2001 14:26:27
- Reply-To: xsl-list at lists dot mulberrytech dot com
>From: "viewga" <viewga@phreaker.net>
>Reply-To: xsl-list@lists.mulberrytech.com
>To: <xsl-list@lists.mulberrytech.com>
>Subject: Re: [xsl] How can I use a variable out of it scope ?
>Date: Wed, 31 Jan 2001 11:44:26 +0200
>
>You can use some trick like that:
>(thats not exactly what you want, but ...)
><xsl:template match="level1">
><xsl:variable name="myVar">Something</xsl:variable>
><xsl:call-template name="level2">
><xsl:with-param name="upperLevelVar"><xsl:value-of select="$myVar"
>/></xsl:with-param>
></xsl:call-template>
></xsl:template>
>
><xsl:template name="level2">
><xsl:param name="upperLevelVar"/>
><!-- doing with upperLevelVar -->
></xsl:template>
>
O.K. it works fine ! But how can I call upperLevelVar on a JavaScript
function argument ?
The following code ...
<IMG SRC="images/open.gif">
<xsl:attribute name="onDblClick">
SetNode('<xsl:value-of select="$upperLevelVar"/>');
</xsl:attribute>
</IMG>
... creates this html ouput :
<IMG SRC="mygif.gif" onDblClick=""></IMG>
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list