|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: for loop
> I have one node that holds a value of say 5 (this number > could be any number > 1-5 ). I need to take that value and create 5 links that > point to different > locations. Since the for-each is only a iterator across node > sets, how > would I handle this. Assuming your number is in $number, the usual trick solution is <xsl:for-each select="//node()[position() <= $number]"> <link/> </xsl:for-each> If you don't like that, the longwinded solution is a recursive named template that takes $number as a parameter, outputs one link, and then calls itself with the parameter set to ($number - 1), terminating when it reaches zero. Mike Kay 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
|

Cart








