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

Re: sorting in groups

Subject: Re: sorting in groups
From: Steve Tinney <stinney@xxxxxxxxxxxxx>
Date: Fri, 31 Dec 1999 01:13:19 -0500
list sorting with groups
This is a known issue in XSLT 1.0.  Take a look through the xsl-list
archives for a variety of solutions, or if you can use Saxon
check out its grouping extension.

 Steve

Mattias Konradsson wrote:
> 
> I have something of a dilemma, I have an xml structure something like this
> 
> <root>
>         <item  category="" type="" date=""></item>
> <root>
> 
> and I want to show all the items in a list, the problem is that I want to
> sort it alphabetically or by date and grouped either by category
> or type so one list might look like this (grouped by category,
> alphabetically )
> 
> Category A
>     Item A
>     Item B
>     Item C
> 
> Category B
>     Item A1
>     Item B1
>     Item C1
> 
> or by type (alphabetically):
> 
> Type A
>     Item A
>     Item B
>     Item C
> 
> Type B
>     Item A1
>     Item B1
>     Item C1
> 
> So I need to make an stylesheet that first picks out all items in one
> category (or type), sorts them after your chosing, then picks the next
> cateogry or type. If I made a tree like this instead of a flat one it
> wouldnt be problem
> 
> <root>
>     <category name="">
>                 <type="" date=""></item>
>     </category name="">
> </root>
> 
> but then again, if I need to group by type then it wouldn't work because
> then the hierarchy would be under type, not category.
> 
> Is there any good way of doing this, and not have to hardcode category and
> type names into the stylesheet? If I'm being
> unclear about what I want to do then please ask me to clarify further. Any
> help would be deeply appreciated.
> 
> Regards
> ------------------
> Mattias  Konradsson
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

-- 
----------------------------------------------------------------------
Steve Tinney                                        Babylonian Section
                                 *   University of Pennsylvania Museum
stinney@xxxxxxxxxxxxx                          Phila, PA. 215-898-4047


 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.