[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: <xsl:for-each>
Dung, Ming-tzung wrote:
Hi, I wonder whether the XSLT has the instruction like the "break" statement in C/Java language inside the loop. If no such instruction, any design idiom can solve this problem? Thanks in advance!!
Instead of for( d in data) { if( d.total > max ) { break; } do-stuff; } you have to select the right node set (which is not trivial in this case): <xsl:for-each select="data[total > $max][1]/preceding-sibling::data"> <stuff/> </xsl:for-each> In most cases, selecting the correct set of nodes is much easier. HTH J.Pietschmann 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
|