Dang Minh Phuong wrote:
I use for-each to loop through all nodes and test the value. If the
condition is true, I'd like to stop the loop.

A xsl:for-each is *not* a loop in the sense this stuff is handled in JavaScript or other procedural languages. It is best thought as executing the body in parallel for each of the selected nodes, therefore, there is no way the processing of one node of the selected node set can influence the processing of another node.

You have to select the right nodes from the beginning, like
 <xsl:for-each select="some-node[position()<5]">
or, more probably, you have a grouping problem. Look into the XSLT
FAQ reachable from
 http://www.mulberrytech.com/xsl/xsl-list/
or ask on the XSL list (state your *original* problem, not the "break
out of a loop" stuff, it's a VFAQ and people may be tired of it).

J.Pietschmann



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to