[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: simple conditional looping

Subject: RE: simple conditional looping
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Mon, 16 Aug 2004 11:50:15 +0100
simple conditional
> 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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.