Try:
<xsl:template match="root">
<xsl:for-each select="element_to_test">
<xsl:choose>
<xsl:when test="position() < 3">
<!-- do processing -->
</xsl:when>
<!-- trap and do nothing -->
<xsl:otherwise />
</xsl:choose>
</xsl:for-each>
</xsl:template>
HTH,
John
-----Original Message-----
From: Simon(_dot_)Fairey(_at_)ft(_dot_)com
[mailto:Simon(_dot_)Fairey(_at_)ft(_dot_)com]
Sent: Monday, March 17, 2003 11:57 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Just the first 'x' elements within a for-each
Hi,
I've tried numerous connotations of for-each loops, recursive functions
etc but for the life of me I can't seem to get something which will only
print/process the first 'x' (in my case x is 2) elements and then bail out
of the for-each or just simply ignore the remaining ones found.
Any help greatly appreciated.
Si
****************************************************************************
******
This email may contain confidential material. If you were not an
intended recipient, please notify the sender and delete all copies.
We may monitor email to and from our network.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list