473,625 Members | 2,687 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to split a grouping into 3 parts

Hi

At first, I thought I could only solve my problem with a C# method inside
my XSLT but I'm beginning to think it might be possible with XSLT only. So
I'm trying, but I need help :-) How can I split a grouping into 3 parts?

I've got the following grouping of countries which is working fine:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et version="1.0" xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:key name="x" match="Country" use="." />
<xsl:template match="Persons" >
<xsl:for-each select="Person[generate-id(Country) = generate-id(key('x',
Country)[1])]">
<xsl:value-of select="Country " /><br />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

But how can I split the grouping into 3 parts. Say there's 11 (unique) countries.
How can I split them into 3 parts so I can produce 3 lists of 4, 4 and 3
elements, e.g.

<ul>
<li>Argentina </li>
<li>Belgium</li>
<li>Canada</li>
<li>Denmark</li>
</ul>
<ul>
<li>England</li>
<li>France</li>
<li>Greece</li>
<li>Hungary</li>
</ul>
<ul>
<li>Iceland</li>
<li>Japan</li>
<li>Kenya</li>
</ul>
Mar 5 '08 #1
0 1518

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2133
by: Luka Milkovic | last post by:
Hello, I have a little problem and although it's little it's extremely difficult for me to describe it, but I'll try. I have written a program which extracts certain portions of my received e-mail. The content of the e-mail is actually predictable, it has one very long list of numbers, something looking like this:
3
12372
by: Xah Lee | last post by:
Split File Fullpath Into Parts Xah Lee, 20051016 Often, we are given a file fullpath and we need to split it into the directory name and file name. The file name is often split into a core part and a extension part. For example: '/Users/t/web/perl-python/I_Love_You.html' becomes
1
2074
by: Brian Coy | last post by:
I am creating a database to track scrap on a daily basis at my plant. I have to provide a weekly scrap report with the amount of each part scrapped per day. I have the basic database set up, and am trying to generate a report. I have created a report that will show all the data. But I need to show either an empty group for the data on days that there is no scrap or a comment relating as much. My report is set up with a weekly...
12
2658
by: Laser Lu | last post by:
Hello, everybody, do you know how to use this Grouping Construct? (?> ) I've found its reference on MSDN, but still can not understand it totally. The following is its description: Nonbacktracking subexpression (also known as a "greedy" subexpression). The subexpression is fully matched once, and then does not participate piecemeal
4
1594
by: Roshawn | last post by:
Hi, I am retrieving a list of book titles from a web service. What I'd like to do is shorten the titles, if possible. For example, there is a book titled "Malicious Mobile Code: Virus Protection for Windows". It would be nice if I could trim the title down to the colon (it would just say Malicious Mobile Code). Is there an easy way to accomplish this task?
14
34930
by: Ron | last post by:
Hello, I am trying to parse a string on the newline char. I guess vbCrLf is a string constant. How can I parse my string - data - on the newline char? .... data += ASCII.GetString(buffer, 0, bytesRead) .... Dim parts() As String = data.Split(vbCrLf)
9
2178
by: needin4mation | last post by:
Hi, I am trying to parse a colon delimited text file. Assume these as examples: Book:mybook Video:myvideo Name:myname When I use this:
4
6036
by: Michele Petrazzo | last post by:
Hello ng, I don't understand why split (string split) doesn't work with the same method if I can't pass values or if I pass a whitespace value: >>> "".split() >>> "".split(" ") But into the doc I see:
9
2308
by: martinskou | last post by:
Hi, I'm looking for something like: multi_split( 'a:=b+c' , ) returning: whats the python way to achieve this, preferably without regexp? Thanks.
0
8182
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8688
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7178
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6115
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4085
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2614
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1496
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.