[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Just the first 'x' elements within a for-each

Subject: Re: Just the first 'x' elements within a for-each
From: Simon.Fairey@xxxxxx
Date: Tue, 18 Mar 2003 10:34:05 +0000
simon fairey
Thanks that worked a treat

Si




Niko Matsakis <niko@xxxxxxxxxxxxx>
Sent by: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
17/03/2003 17:09
Please respond to xsl-list

 
        To:     xsl-list@xxxxxxxxxxxxxxxxxxxxxx
        cc: 
        Subject:        Re:  Just the first 'x' elements within a for-each


one simple way:

<xsl:for-each select="some-expr">
  <xsl:if test="position() &lt;= 2">
    <!-- print/process the element here -->
  </xsl:if>
</xsl:for-each>

Simon.Fairey@xxxxxx wrote:

>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
>
> 
>

-- 
DataPower technology
http://www.datapower.com




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






**********************************************************************************
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.