Re: [xsl] How can I use a variable out of it scope ?

Subject: Re: [xsl] How can I use a variable out of it scope ?
From: "frank Stein" <freeposte@xxxxxxxxxxx>
Date: Wed, 31 Jan 2001 14:26:27



From: "viewga" <viewga@xxxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
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



Current Thread