Re: XSL sort

Max Froumentin wrote:
> 
> "Kevin O'Riordan" <koriordan99@hotmail.com> writes:
> 
> > In my view, it is unintuitive and confusing to have the
> > 'sort' instruction at this level when it really pertains to the whole
> > iteration. I think a syntax like this makes more intuitive sense.
> >
> >
> > <xsl:for-each select="catalog/cd" sort="artist">
> 
> A similar solution had been suggested in the WG around 1998. The
> problem is that you need a whole bunch of attributes for each sort key
> (data type, ascending/descending, upper/lower case) and there wouldn't
> be an easy way to specify some or all them for each sort key as
> attributes of the same element.

Well, you could pack all those attributes right into the xsl:for-each. 
I think the more convincing argument against this is that the status quo
allows simple expression of multi-level sorting.

<xsl:for-each...>
  <sort select="level1"/>
  <sort select="level2"/>
  ...
</xsl:for-each>

-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Boulder, CO 80301-2537, USA
XML strategy, XML tools (http://4Suite.org), knowledge management

Received on Wednesday, 9 January 2002 10:27:32 UTC