|
[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,
But you've been on this list long enough to have seen 10001 messages
telling you that you can not change the value of a variable once it is
bound.
If $iTimeZoneOffset is -1 then you can not chage its value to be
anything else.
If it is a parameter to a template you can call teh template passing a
new value as parameter.
> the first time using $iCurrentOffset and the second time using
> $iTimeZoneOffset
so make all of that code a named template with a parameter offset
then call it once with offset set to $iCurrentOffset and once with
offset set to $iTimeZoneOffset.
Of if you don't actually need to call it twice but just want to
call it once, but with a value thatdepends on some condition, change the
code to use $offset insetaed of $iCurrentOffset then before you execute
that block do
<xsl:variable name="offset">
<xsl:choose>
<xsl:when .....>
<xsl:value-of select="$iCurrentOffset"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$iTimeZoneOffset"/>
</xsl:otherwise>
<xsl:choose>
</xsl:variable>
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
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
|

Cart








