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

Re: Acheiving ..2nd level grouping but with different

Subject: Re: Acheiving ..2nd level grouping but with different node structure ..
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 24 Jul 2002 14:19:15 +0100
Re:  Acheiving ..2nd level grouping but with different
Hi Kumar,

> Here is my XSL with first level grouping extracting distinct regions
> and i am having problems grouping users within Region .

The secret of 2nd level grouping with the Muenchian method is to
create keys that combine the two things that you want to group by.
Your first level key is:

<xsl:key name="distinct-region" match="*" use="@reg"/>

(Though I think it would be better as:

<xsl:key name="distinct-region" match="los" use="@reg"/>

since that would limit it to only holding los elements.)

So your second level key should be something along the lines of:

<xsl:key name="distinct-region-and-user" match="los"
         use="concat(@reg, '+', @user)" />

Then, given that you've found a region ($reg), you can get all the
unique users in that region with:

  key('distinct-region', $reg)
    [generate-id() =
     generate-id(key('distinct-region-and-user',
                     concat($reg, '+', @user)))]

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.