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

Re: Grouping problem

Subject: Re: Grouping problem
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 12 Jun 2003 12:04:37 +0100
xsl key subgrouping

> The problem I'm having is I'm trying to use Meunchian grouping and while I
> can get the first grouping using

The trick to doing subgrouping using keys is to note that xslt doesn't
have compound key values so you have to fake it using string
concatenation.

For your outer group you group on Division so have

<xsl:key name="resources-div" match="resource" use="Division" />


for your inner group you want to group things which have the same
author so

<xsl:key name="resources-div-auth" match="resource" use="concat(Division,':',author)" />

and use a similar concat in the key()

actually since your input looks like

			<Division>
				A
			</Division>

and you probably want that to be in the same group as


			<Division>
    A
			</Division>


you would be better to have

<xsl:key name="resources-div" match="resource" use="normalize-space(Division)" />
and similarly normalize-space(Division) an normalize-space(Author) in
the second key, and in calls to this key with the key() function.

Note you'll often find people on this list supply working code as well
as (or instead of) explanantaions, but to get that it helps to be given a well
formed input document, your sample input was very long, but not well formed.
for example

			<Div Head>
				Person C	
			</Div Head>

isn't XML.


As always with grouping things have a look at Jeni's site.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 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.