[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: setting variables in xslt
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: 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: 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|