This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Break a for-each


> My problem is as follows :
> - If I find the subsetName in the first CurrentAuthentified how can I break the 
> loop ?
> 

You can't "break" from a xsl:for-each (except with a 'xsl:message terminate="yes"',
which you obviously do not want to do).

This is because you cannot rely on the ordering of execution (or even its being
executed sequentially in any order!) of the body of an xsl:for-each.

The solution is:

 - briefly: (serialise/)convert the xsl:for-each loop into a recursive template and
return (do not call yourself) as soon as the break condition becomes true.

 - with more detail: 
http://www.vbxml.com/snippetcentral/main.asp?view=viewsnippet&id=v20010228100123


Hope this helped.

Cheers,
Dimitre Novatchev.




__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]