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

RE: Group and sort by group element occurrences

Subject: RE: Group and sort by group element occurrences
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 19 Aug 2003 08:44:03 +0100
josh simerman
As a long time reader, you should know that you will get a reply asking
you to post your code! We can't tell you what you're doing wrong unless
you show us what you're doing.

(Someone might post you a solution, but not me. That's not just because
I'm too busy to write code for people, it's because I don't think it's a
good way of learning. Your error might be a simple typo, or it might
reflect a deep misunderstanding of the concepts, and before I can give
you useful advice, I need to know which is the case.)

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Simerman, Joshua Michael
> Sent: 19 August 2003 04:43
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Group and sort by group element occurrences
> 
> 
> Long time reader, first time poster.
> 
> I have an xml doc that is the result of a keyword search, 
> which list the keyword, and all pages by id that have that 
> instance of the keyword. The output looks like this.
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <docroot>
> 	<token>apply
> 		<pageid>1</pageid>
> 		<pageid>3</pageid>
> 		<pageid>84</pageid>
> 	</token>
> 	<token>international
> 		<pageid>3</pageid>
> 		<pageid>5</pageid>
> 		<pageid>84</pageid>
> 	</token>
> 		<token>financial aid
> 		<pageid>5</pageid>
> 		<pageid>84</pageid>
> 	</token>
> </docroot>
> 
> I need to transform this this into a grouped and sorted list 
> of page id's, so that the instances of pageid that occur the 
> most frequently are first, and so that each pageid is listed 
> only once. The above xml would then look like this.
> 
> <docroot>
> 	<pageid>84</pageid>
> 	<pageid>3</pageid>
> 	<pageid>5</pageid>
> 	<pageid>1</pageid>
> </docroot>
> 
> It seems like a fairly simple transform, but I just cant get 
> it to sort properly and then have only the unique page ids. I 
> just end up with a flat list of the original document, or 
> nothing at all.
> 
> Thanks,
> 
> Josh Simerman
> Graduate Assistant, Web Developer
> Systems & Accounting Graduate Programs
> Indiana University, Kelley School of Business
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 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.