Subject: RE: Incrementing variables From: "Chris Bayes" <Chris@xxxxxxxxxxx> Date: Tue, 5 Sep 2000 23:25:34 +0100 |
um No. Think scope. It is only :constant within the current scope. Think recursion and it isn't. XML/XSL Portal http://www.bayes.co.uk/xml >-----Original Message----- >From: owner-xsl-list@xxxxxxxxxxxxxxxx >[mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Tom Power >Sent: 05 September 2000 22:49 >To: 'xsl-list@xxxxxxxxxxxxxxxx' >Subject: RE: Incrementing variables > > >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@xxxxxxxxxxx] >Sent: None >To: XSL-List@xxxxxxxxxxxxxxxx >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@xxxxxxxxxxx > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Incrementing variables, Tom Power | Thread | RE: Incrementing variables, Chris Bayes |
RE: Incrementing variables, Tom Power | Date | RE: Incrementing variables, Chris Bayes |
Month |