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

how to group equal nodes by a it's position()

Subject: how to group equal nodes by a it's position()
From: Dmitri Ilyin <dmitri.ilyin@xxxxxxxxx>
Date: Fri, 28 Sep 2001 21:15:17 +0200
 how to group equal nodes by a it's position()
Hi *,

i have next xml:

<calls>
 <call>sme text</call>
 <call>sme text</call> 
 <call>sme text</call>
 <call>sme text</call>
 <call>sme text</call>
 <call>sme text</call>
 <call>sme text</call>
 <call>sme text</call>
 <call>sme text</call>
 <call>sme text</call>
 .....
 <call>sme text</call>
</calls>

i have to group the <call> by it's position()
to get 
<table_1>
 <call>some text</call> 
 from position 1 to 10 (10 elements in the table_1)
 <call>some text</call> 
</table_1>
<table_2>
 <call>some text</call> 
  from position 11 to 25 (15 elements in table_2)
</table_2>
....
<table_n>
 <call>some text</call> 
  from position 26 to 40 (15 elements in table_n)
</table_n>

<table_x>
 <call>some text</call> 
  from position nnn to mmm (20 elements or less in table_x)
</table_x>

So I have 3 types of tables, with 10, 15, 20 elements.
The number of call nodes in table 1 must be 10 and it must be first 10
elements,
the number of call nodes in tables 2 to n must be 15,
the number of call nodes in last table must be 20 or less.

the number of call elements can be different. 
eg i have 100 call elements
so i have to put in the first table 10 elements, 
in the tables from 2..6 15 elements
and in the last table 15 elements. 

If i have 106 elements i could put in last table 20 (and make the last table
complete) 
elements end still have ones more element, 
so i have to create one more table with 15 elements and put in the last
table the last 6 elements.


are there any solutions of that problem???

thanks for advise

Dmitri

 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.