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

grouping by attribute

Subject: grouping by attribute
From: "Sargeant, Richard (GEIS)" <Richard.Sargeant@xxxxxxxxxxx>
Date: Sun, 15 Aug 1999 17:47:39 +0200
richard sargeant
Hi, 

   Is there a better way to achieve the following. My XML file contains item
with a category attribute and I need to group each category separately, for
example

	<item category="aaa">xxxxxxx</item>
	<item category="bb">xxxxxxx</item>
	<item category="zzz">xxxxxxx</item>
	<item category="bb">xxxxxxx</item>
	<item category="yyy">xxxxxxx</item>

   At the moment I simply use <xsl:sort select=@category/> to sort and then
test if the category changes by comparing the current category with the
previous item's category. 

   I know I can use a xsl:for-each and select each category in turn but is
it possible to select all the items of each category without having hardcode
the category into the xsl script ?

regards
   Richard Sargeant


 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.