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

Re: Grouping on multiple nested elements

Subject: Re: Grouping on multiple nested elements
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 16 Jul 2002 09:38:32 +0100
nested muenchian method
Hello Paul :)

> I have no problem grouping by program_name using the Muenchian
> method - there is only one program_name for each story. However,
> grouping by subject has me stumped - do I need multiple keys and how
> do I keep track of the current subject?

The essential hint here is that when you use the Muenchian Method you
must have a 1:1 correspondence between the nodes that you're grouping
and the values that you're grouping by. When you're grouping stories
by program name, that's fine because each story only has one program
name. If you want to group stories by subject you have to go one
level down and actually group subject elements by their value:

<xsl:key name="bySubject" match="story/subjects/subject" use="." />

Then do the normal Muenchian Method stuff, except selecting the
subject elements and moving up the tree to their ancestor story in
order to get information about ... oh, like I see Jarno's just posted
:)

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.