This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Sorting and Grouping revisited
- To: "Peet, Mike" <MPeet at ChoiceOneCom dot Com>
- Subject: Re: [xsl] Sorting and Grouping revisited
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Thu, 19 Apr 2001 08:39:09 +0100
- CC: "'XSL-List at lists dot mulberrytech dot com'" <XSL-List at lists dot mulberrytech dot com>
- Organization: Jeni Tennison Consulting Ltd
- References: <CEB88B92CE0AD511AB1E00508BC5C7BD5555ED@rocexc2.choiceonecom.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Mike,
> This isn't really a question, other than to ask, 'am I crazy for
> expecting XSLT to be able to handle sorting and grouping
> gracefully?'
No, you're not. XSLT handles *sorting* fairly well, but it doesn't
handle grouping at all well, and won't until XSLT 2.0. There are
techniques for doing grouping that work OK, but they're not
particularly easy to get to grips with - see
http://www.jenitennison.com/xslt/grouping for more details.
> It seems to me the best bet for accomplishing what I need to do is
> to restructure my XML. As another member of this group noted, this
> is changing the data subtly for a presentation reason. This seems
> wrong.
It's 'wrong' if you change the *underlying* XML to suit the
presentation. However, you could have a preprocessing stylesheet that
takes the XML data and sorts it, before the data is then passed on to
the presentational stylesheet. This isn't 'wrong' at all - in fact
it's a good approach to the problem, better than performing the
complex transformation in a single step.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list