This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
declaring global variable in XSL!
- To: "Gitanjali" <narsu at gitanjali dot com>, <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] declaring global variable in XSL!
- From: "Syed Abuthaheer" <abuthaheer dot syed at infoworld dot com dot my>
- Date: Tue, 21 Aug 2001 12:00:55 +0800
- References: <20010821021729.14815.qmail@web11104.mail.yahoo.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
hi all,
how can i declare a global variable whose value has to be updated based on
some condition?
for eg:
<xsl:param name="js_var"/><!-- I am passing this variable from javascript-->
<xsl:variable name="var">zero</xsl:variable><!-- assigning default value for
the variable "var" -->
<xsl:if test="$js_var='1'">
<xsl:variable name="var">one</xsl:variable>
</xsl:if>
<xsl:if test="$js_var='2'">
<xsl:variable name="var">two</xsl:variable>
</xsl:if>>
<xsl:value-of select="$var"/>
the above code is not giving the proper output. can anybody help me to solve
this problem?
thanks in advance.
regards,
syed.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list