RE: variable incrementing problems

Subject: RE: variable incrementing problems
From: Eugeny Kuzakov <kev@xxxxxxxxx>
Date: Tue, 29 Jun 1999 14:12:31 +0700 (OSS)
On Mon, 28 Jun 1999, Kay Michael wrote:

> You cannot use xsl:variable to assign a new value to an existing variable:
> what your code is doing is to create a new variable of the same name, and
> when this goes out of scope (at </xsl:if>) your code picks up the earlier
> variable in preference.

Ok. Thanks for answer. I am solved my problem now.
But how can I increment value already existing variable?

Another question: I am declare variable (DebubOpts) in template that
should match root element. This template call another templates. But there
is no variable DebugOpts in "child's" templates that called from main
template....??

> Try this:
> 
> 	<xsl:variable name="FolderRowSpan1">
> 	<xsl:choose>
> 	<xsl:when test="count(highligth)+count(subfolder/highligth) &gt; 0">
> 		1</xsl:when>
> 	<xsl:otherwise>0</xsl:otherwise>
> 	</xsl:choose>
>     	<xsl:variable name="FolderRowspan">
> 		<xsl:value-of select="count(subfolder)*2 + 1 +
> $FolderRowSpan1"/>
>     	</xsl:variable>
I am tryed this:
 	<xsl:variable name="FolderRowSpan">
 	<xsl:choose>
 		<xsl:when test="count(highligth)+count(subfolder/highligth) &gt; 0">
 			<xsl:value-of select="count(subfolder)*2 + 2"/>
		</xsl:when>
 		<xsl:otherwise>
			<xsl:value-of select="count(subfolder)*2 + 1"/>
		</xsl:otherwise>
 	</xsl:choose>
     	</xsl:variable>

--
	Best wishes, Eugeny Kuzakov
		Laboratory 321 ( Omsk, Russia )
		kev@xxxxxxxxx
		ICQ#: 5885106



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread