xsl-list
[Top] [All Lists]

Re: updating xsl:variable inside the loop

2004-01-29 04:38:57
Arulraj wrote:

Hi,
  I am using xsl:variable inside the loop.
xsl:variable should be updated in next iteration. How to do this?

You cannot. The value of a variable, once initialized, cannot be changed.

Usually, you achieve your goal using xsl parameters, template calling and recursion. Your case is easier if i understand corfrectly as you can use the position function:

 <xsl:for-each select="child::*">
   <xsl:if test="(position() &lt; @rowindex)">
     <xsl:text>tableRow = new H2WTableRow();<xsl:text>
   </xsl:if>
 </xsl:for-each>


hth,

Manos

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