[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|