This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Sorting and Grouping revisited


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]