This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Incrementing variables
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Incrementing variables
- From: Tom Power <TomP at AdvantageGroup dot co dot nz>
- Date: Wed, 6 Sep 2000 09:48:46 +1200
- Reply-To: xsl-list at mulberrytech dot com
you'd be forgiven for thinking that the 'variable' in xsl:variable means you
can change the value as often as you please.
the element should be named xsl:constant because that's what it is.
-----Original Message-----
From: Joerg Colberg [mailto:joerg.colberg@econovo.com]
Sent: None
To: XSL-List@mulberrytech.com
Subject: Incrementing variables
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.
joerg.colberg@econovo.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list