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 09:50:53 +0530
Message-ID: <CABuuzNPRkkfd6R1JbgGYSvV3L-QbtPiPFj943vtg-FfQ09oxbQ@mail.gmail.com>
To: Christian Grün <cg@basex.org>
Cc: public-xslt-40@w3.org
On Fri, Jan 15, 2021 at 12:01 PM Christian Grün <cg@basex.org> wrote:

> If the input is numeric, the function argument can be used for that:
>
>   sort($data, (), function($key) { -$key })
>

I think, you imply the intent, and I agree.

For correctness sake, I guess you meant,
sort($data, (), function($key) { 0 - $key })


> In others, you can use a subsequent fn:reverse call:
>
>   reverse(sort($data))
>

Wouldn't this be inefficient, as compared to having a native "descending"
argument to the fn:sort function? Yes, but for now, reverse(sort($data))
would work for us.


-- 
Regards,
Mukul Gandhi
Received on Saturday, 16 January 2021 04:21:22 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 16 January 2021 04:21:23 UTC