This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
alternating node type in a loop
- From: "Tyler Queen" <xmllist at telocity dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 12 Jul 2002 12:21:14 -0700 (PDT)
- Subject: [xsl] alternating node type in a loop
- Reply-to: xsl-list at lists dot mulberrytech dot com
I want to loop through all the article nodes within a
section element. The problem is I want to alternate the
way they are looped by "type" going "1,2,1,2,1,2" and
then when there aren't anymore to alternate through
finish looping through the remaining nodes.
Any Ideas?
This is the xml
<articles>
<section>
<article type="1">Article</article>
<article type="2">Article</article>
<article type="2">Article</article>
<article type="1">Article</article>
<article type="2">Article</article>
<article type="1">Article</article>
<article type="1">Article</article>
<article type="1">Article</article>
</section>
<articles>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list