Incrementing variables

Subject: Incrementing variables
From: "Joerg Colberg" <joerg.colberg@xxxxxxxxxxx>
Date: Tue, 5 Sep 100 16:30:12 EDT
   How can one use incremental variables? Assume I have a node NODE1 which has, say, ten, children (NODE2). Assume I define the following variable:
<xsl:variable name="var" select="NODE1/NODE2[1]"/>
This gives me the first child of NODE1. How do I go to the next child
and then the next child etc. that is how can I run an iteration over
the children? I tried
<xsl:variable name="var" select="$var/following-sibling::"/>
but that didn't do it.
   The question might sound funny - can't I use a for-each loop? The
reason why I can't in my particular context is because I have to
use the variable inside a for-each loop. What I basically want to
increment the child every time the for-each loop goes to the next
node. Sounds a little weird but that's (partly) because the problem
is given out of context here.

I'd appreciate any tip!

Thanks, Joerg

Dr Joerg M. Colberg
Econovo Software, Inc.

 XSL-List info and archive:

Current Thread