xsl-list
[Top] [All Lists]

Re: Counting using variable inside the loop

2004-03-11 02:44:31
Thank you Jeni Tennison
This counting works fine.

--- Jeni Tennison <jeni(_at_)jenitennison(_dot_)com> 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