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

Re: Grouping (yet again)

Subject: Re: Grouping (yet again)
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 19 Feb 2002 17:55:21 +0000
Re:  Grouping (yet again)
Hi Steven,

> all-in-all, it looks pretty well, but something is wrong with the
> grouping...: the numbers are completely incorrect :-(

Well, you're generating one datum element per dir per week per group.
The value attribute of the datum element for that particular
dir/week/group is the value of the value attribute of the *first*
datum element in the source document with that dir/week/group.

You don't say what's wrong with the numbers (aside from being
incorrect) but I'm guessing that you want that value to be the sum of
all the value attributes of the datum elements with the same
dir/week/group? In that case, you need to generate it with:

  <datum dir="{@dir}"
    value="{sum(key('datum-groupyearweekdir',
                    concat(@group, '-', @year, '-', @week, '-', @dir))
                  /@value)}" />

In the description you also say that you want the datum for each week
to include a total attribute that holds the sum of the value
attributes for that week. You don't currently have that in your
stylesheet, but it will follow the same pattern as above.

If that isn't what's wrong with the numbers, do post again with more
details.

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.