W3C home > Mailing lists > Public > public-xslt-40@w3.org > January 2021

Re: improvements to fn:sort functions

From: Mukul Gandhi <gandhi.mukul@gmail.com>
Date: Sat, 16 Jan 2021 11:50:49 +0530
Message-ID: <CABuuzNOm4J1FuKx2xTHt-g=Mza3L5+xKEmbU7j23xGquCTawaA@mail.gmail.com>
To: Michael Kay <mike@saxonica.com>
Cc: Christian GrĂ¼n <cg@basex.org>, public-xslt-40@w3.org
On Fri, Jan 15, 2021 at 1:54 PM Michael Kay <mike@saxonica.com> wrote:

> One approach might be to provide an extended form of the collation-key()
> function which can be used something like this:
> sort($data, by: sort-key([
>     map{'select': ->{last-name), 'order': 'ascending', 'collation':
> $surname-collation},
>     map('select': ->(first-name), 'order': 'descending', 'collation':
> $firstname-collation}]))

I really, like this idea, and would support adding it to XPath 4.0 (and
hence, to XSLT 4.0 as well). This shall make the XPath fn:sort function,
completely defined, with respect to having any number of sort keys.

(I think, you made a little typo at {last-name). You probably wanted, a
left parenthesis instead of a left curly brace.)

> But I wonder if it's really needed, since both XSLT and XQuery have this
> level of capability already. We don't have to put everything into XPath.

I think that, its quite likely, XPath (all versions) could be used in
contexts other than XSLT and XQuery (although, these are the most common
uses of XPath). I guess, adding the discussed fn:sort function
improvements, shall be helpful in long run.

Mukul Gandhi
Received on Saturday, 16 January 2021 06:21:19 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 16 January 2021 06:21:19 UTC