Subject: RE: [xsl] setting variables in xslt From: "Stevenson Ngila" <Stevenson@xxxxxxxxxxxxxxxxxxxxxx> Date: Thu, 21 Nov 2002 13:37:24 +0300 |
what i want to do is: <xsl:when test="$iTimeZoneOffset= '-1'">, set $iTimeZoneOffset to be $iCurrentOffset, since the operation in the <xsl:when> statement is also been repeated in <xsl:otherwise>. This will help me optimise my code what is been repeated is: <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><><><><><><><><><><><><><><><><> <xsl:choose> <xsl:when test="$iHour < $iTimeZoneOffset "> <xsl:value-of select="($iDate - 1)"/><xsl:value-of select="$iMonthYear"/>, <xsl:value-of select="($iHour + 24) - $iTimeZoneOffset"/><xsl:value-of select="$iMinutes"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$iDate"/><xsl:value-of select="$iMonthYear"/>, <xsl:choose> <xsl:when test="$iHour < '10'"> 0<xsl:value-of select="$iHour - $iTimeZoneOffset"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$iHour - $iTimeZoneOffset"/> </xsl:otherwise> </xsl:choose> <xsl:value-of select="$iMinutes"/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><><><><><><><><><><><><><><><><> the first time using $iCurrentOffset and the second time using $iTimeZoneOffset. But with setting $iTimeZoneOffset to be $iCurrentOffset, i will only have to write the above code once. -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Michael Kay Sent: 21 November 2002 13:10 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] setting variables in xslt You can't modify variables in XSLT, it is a declarative language. This is a FAQ, and the answer is always the same: tell us what problem you are trying to solve, so we can tell you how you should be tackling it. Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of > Stevenson Ngila > Sent: 21 November 2002 08:29 > To: Xsl-List@Lists. Mulberrytech. Com > Subject: [xsl] setting variables in xslt > > > if i have: > > <><><><><><><><><><><><><><><><><><><><><><><><> > <xsl:when test="$iTimeZoneOffset= '-1'"> > > </xsl:when> > <><><><><><><><><><><><><><><><><><><><><><><><> > > how can i set $iTimeZoneOffset to another variable say iCurrentOffset > > > Thanks, > Stevenson Ngila > Footman-Walker Associates Ltd > http://www.footman-walker.co.uk > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] setting variables in xslt, Michael Kay | Thread | Re: [xsl] setting variables in xslt, David Carlisle |
Re: [xsl] Element value, Laura | Date | Re: [xsl] Element value, Vasu Chakkera |
Month |