xsl-list
[Top] [All Lists]

RE: simple conditional looping

2004-08-16 03:50:15

Mukul, Chris and Andrew thank you very much for prompt help. 
I implemented 
recursive template and it works fine.

Andrew, I am using msxsl processor, is there any work-around 
for it similar 
to Saxon?
p.s. portability is important.

Well yes there is, it's sometimes known as the 'Piez method' after
Wendell Piez on this list, but it's more of hack than a solution (which
Wendell will be the first to tell you :)

If you have more elements in your source than you need for your
iteration, then you can use: 
 
  <xsl:for-each select="//*[position() &lt; 50]">
    ...
  </xsl:for-each>

This simply selects all elements in the document and iterates over them.
If you want to 'loop' 50 times, then simply iterate over 50 elements.
If you don't have 50 elements in your  source then you won't be able to
iterate 50 times...

In your particular case I would stick with the recursive template
solution.

Cheers
andrew


<Prev in Thread] Current Thread [Next in Thread>