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

RE: Divide to pages

Subject: RE: Divide to pages
From: "Gabriel Osorio" <gosorio@xxxxxxxxxxx>
Date: Wed, 5 Apr 2006 09:22:40 -0500
gabriel osorio
Maybe this helps:
<xsl:param name='items-by-page' select='5'/>

... Number of pages:
<xsl:variable name='pages' select='floor(count(item) div $items-by-page)'/>

... With a recursive loop, with params: counter from 1 to pages
<xsl:if test="position() = ($items-by-page*$counter)">EOP</xsl:if>


-----Original Message-----
From: Paull [mailto:paullus4mlist@xxxxxxxxx] 
Sent: Wednesday, April 05, 2006 8:08 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Divide to pages

Hello All,
following xml:
<data>
<item name="1" id="i1">v1</item>
<item name="2" id="i1">v2</item>
<item name="3" id="i1">v1</item>
<item name="4" id="i1">v1</item>
<item name="5" id="i1">v2</item>
<item name="6" id="i1">v1</item>
<item name="7" id="i1">v1</item>
<item name="8" id="i1">v2</item>
<item name="9" id="i1">v1</item>

<item name="10" id="i2">v2</item>
<item name="11" id="i2">v2</item>
<item name="12" id="i2">v2</item>


<group name="g1" id="i1"/>
<group name="g2" id="i2"/>
</data>
should be transformed to the xml, where items are grouped by id, and 
divided to pages whith 5 items per page. Result should be like following:
g1
1. i1v1
2. i1v2
3. i1v1
4. i1v1
5. i1v2
EOP
1. i1v1
2. i1v1
3. i1v2
4. i1v1
g2
5. i2v2
EOP
1. i2v2
2. i2v2

I can group it, but how to divide for pages - no idea ...
WBR, Paull

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.