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: Jumping out a loop


> I have the following loop:
>
> <xsl:for-each select="Grasslands/*[position()&gt;3 and text()]">
> 	<h3><font color="#00007f"><i><xsl:value-of
> select="name()"/></i></font></h3>
> 	<p><font color="#008000"><xsl:value-of select="."/></font></p>
> </xsl:for-each>
>
> I want to jump out the loop

It helps to think about these problems if you understand the processing
model. <xsl:for-each> isn't a loop: it's a function mapping. It says that in
the output you want one Y for every X that appears in the input. Since it's
not a loop, jumping out of it doesn't make sense. What you need is a
different function.

I can't answer your problem without understanding your requirement better,
but it looks to me as if you want two <xsl:for-each> instructions:

<xsl:for-each select="one set of nodes">...</xsl:for-each>
<xsl:for-each select="another set of nodes">...</xsl:for-each>

Mike Kay
Software AG


 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]