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

Re: for-each n number of times, multiple times

Subject: Re: for-each n number of times, multiple times
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 23 Aug 2005 16:18:33 +0100
n number of times
> the current version of the xsl gives me the first group of 
> sixty on one page, but I cannot figure out how to process the rest, sixty at 
> a time.  Any help would be greatly appreciated.

process every 60'th item, and for each one make a page by processing
that one and its 59 following siblings

so in general:

<xsl:for-each select="item[position() mod 60 = 1]">
  <page>
<xsl:apply-templates select=".|following-sibling::item[position()&lt;60]"/>
  </page>
</xsl:for-each>

  <!--          <xsl:for-each select="//TRANSACTION/PAYMENT[ position() mod 
60 = 1 ]">    -->

Don't use // it means "spend ages searching the entire document to
arbitrary depth, looking for TRANSACTION elements.

/PAYMENT[ position() mod 60 = 1 ]

in a step position() counts items in that step, so this is just counting
PAYMENT within this TRANSACTION, and probably there is only one of those
per transaction.

So you want exactly teh "general" form above, with item replaced by
TRANSACTION.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.