Re: xsl: for-each break

I don't think there is something as such as a break in xsl:for-each. 
Instead, you can use a recursive template. You can find a number of 
examples at http://www.jenitennison.com/xslt/

Regards Oliver

Marek Hubatka wrote:
> Hi.
> 
> I have a problem... I need to make a break or something in a xsl: for-each. It has to act like a "while" command in other languages. so it must do a for-each until a condition is not valid any more.
> 
> The sense of this is, that i got a xml file with some "group" nodes in it. one or more group node is in another. i do a xsl:for-each select="descendant::group". in this for-each it looks for a node "record" in the deepest group-node. when it finds a record, it does something and will make a for.each select="ancestor::group" to get the parents. for each parent it tests, if it is the last group of the parent ( xsl:if test = ". = ../group[last()]" ). when it find one group, which is NOT last(), it has to cancel and not process the parents of this node.
> 
> Any ideas?
> 
> THX
> MiB
> 

Received on Friday, 19 December 2003 09:46:23 UTC