RE: [xsl] Assigning values to variables

Subject: RE: [xsl] Assigning values to variables
From: Suresh Kumar T <sureshkumart@xxxxxxxxxxxxxxx>
Date: Mon, 20 Aug 2001 22:01:23 +0530
you cannot reassign a variable once you declare. If you give more details
about what u intend to do using this.. we may help..

Regards
suresh

-----Original Message-----
From: Haque, Suraiya [mailto:Suraiya.Haque@xxxxxxx]
Sent: 20 August, 2001 7:02 PM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: [xsl] Assigning values to variables 


How do you assign values to a variable once they've already been declared? I
have a simple template as follows, but I can't assign a value to LastDate as
I'd like:

<xsl:variable name="LastDate">None</xsl:variable>
<xsl:template name="DoTitle">
    <xsl:param name="Date">N/A</xsl:param>
    <xsl:param name="Time">N/A</xsl:param>

    <xsl:variable name="CurrentDate" select="concat($Date,$Time)"/>
	<xsl:if test="$LastDate = 'None'">
    <td>First<xsl:value-of select="$LastDate"/>/<xsl:value-of
select="$CurrentDate"/></td>
    </xsl:if>
	<xsl:if test="$CurrentDate = $LastDate">
    <td><xsl:value-of select="$Date"/>:<xsl:value-of select="$Time"/></td>
    </xsl:if>
	<xsl:if test="$CurrentDate != $LastDate">
    <td></td>
    </xsl:if>
</xsl:template>

Thanks for any help!

 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