Re: [xsl] Counting using variable inside the loop

Subject: Re: [xsl] Counting using variable inside the loop
From: Arulraj <p_arulraj@xxxxxxxxx>
Date: Thu, 11 Mar 2004 01:44:31 -0800 (PST)
Thank you Jeni Tennison
This counting works fine.

--- Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> wrote:
> Hi Arulraj,
> 
> > But I want to make a count row, when I reach first
> row I should this
> > is first row. when next row encounter I should say
> this is second
> > row.
> 
> Use <xsl:number> (no need to specify any attributes)
> to give you these
> numbers, or calculate them yourself by counting the
> number of
> preceding sibling rows to the current one, and
> adding one, with:
> 
>   count(preceding-sibling::row) + 1
> 
> > I tried with <xsl:variable>
> 
> You can't change the value of a variable in XSLT
> (it's a declarative
> language rather than a procedural one). If you were
> stepping through
> the <row> elements one by one, you could use a
> parameter to keep track
> of them, but usually one of the above methods works
> fine.
> 
> Cheers,
> 
> Jeni
> 
> ---
> Jeni Tennison
> http://www.jenitennison.com/
> 
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> 


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you?re looking for faster
http://search.yahoo.com

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


Current Thread