[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Break the For-each loop
> So how do I break the loop after I have > found the first apple? You never break out of a for loop in xslt. It is best to assume that you are using a massively parallel machine and all items in the loop are executed _in parallel_ and assembled into the final output in a specified order which might be totally unrelated to the order in which they are evaluated. (Even if in fact you are on a sequential machine an XSLT compiler may (and some do) execute the items in orders which don't correspond to the natural order that you might expect. So don't break the loop: just select the items that you want to process, for example if you want to process all the children up to and including the first apple do <xsl:for-each select="apple[1]/preceding-sibling::*|apple[1]"> David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
|
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
|