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

RE: sorting and grouping

Subject: RE: sorting and grouping
From: "m.vanrootseler" <m.vanrootseler@xxxxxxxxx>
Date: Sat, 3 Jul 2004 15:09:56 +0200
xpath sort sibling
Thanks for the link, Michael. I was already afraid I'd have to use Muenchian
grouping, something that I've never done before. 

Mick


-----Oorspronkelijk bericht-----
Van: Michael Kay [mailto:mhk@xxxxxxxxx] 
Verzonden: vrijdag 2 juli 2004 14:57
Aan: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Onderwerp: RE:  sorting and grouping

You'll find the answer at http://www.jenitennison.com/xslt/grouping

Michael Kay 

> -----Original Message-----
> From: m.vanrootseler [mailto:m.vanrootseler@xxxxxxxxx] 
> Sent: 02 July 2004 13:40
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  sorting and grouping
> 
> I've got a sorting problem. My XML is as follows:
> 
> <person>
> 	<name>Kermit</name>
> 	<birthday>3</birthday>
> 	<birthmonth>January</birthmonth>
> </person>
> etc. 
> 
> XSLT:
> 
> <xsl:for-each select="person[birthmonth='January']">
>     <xsl:sort select="birthday" data-type="number"/>
>     <xsl:sort select="name"/>
>     <xsl:value-of select="birthday"/>
>     <xsl:text> - </xsl:text>
>     <xsl:value-of select="name"/>
>     <br/>
> </xsl:for-each>
> 
> With the above code, each birthday number is repeated. What I 
> would like is
> to have the birthday number appear only once followed by the 
> names of people
> whose birthday that is. I suspect it can be done by testing 
> if the birthday
> value is the same as the preceding sibling, but I can't get 
> it right. Does
> anyone have any idea how to solve this? 
> 
> Mick
> 
> 
> 
> --+------------------------------------------------------------------
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> --+--
> 
> 


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
--+--


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.