[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: for-each question
Alec Cove wrote: > Is there a way to specify how xsl:for-each iterates? > > For example to have it loop by two in the style of: > for (int i = 0; i < 20; i += 2) You can't increment an arbitrary counter, but if you want to iterate over every 2nd node in a set: <xsl:for-each select="/xpath/for/some/nodes[position() mod 2 = 1]"> for example. Generally, the problems people want to solve by counting from 0 to n are things that can be solved without using a counter at all. Post your actual problem if this isn't helpful. - Mike ____________________________________________________________________ Mike J. Brown, software engineer at My XML/XSL resources: webb.net in Denver, Colorado, USA http://skew.org/xml/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|