> On 3 Dec 2015, at 13:10, Michael Kay <[email protected]> wrote:
> 
> As Rob points out, the simplest solution for simple cases is to use reverse().
> 
> That doesn't work if you want a composite sort key - sort by ascending 
> country then descending city. (Yes, an unconvincing use case, and frankly 
> it's because of the difficulty of finding a convincing use case that we 
> didn't include this capability).
> 
> If you know that the result of collation-key() will be xs:base64Binary then 
> you can do it, I suspect, by 
> 
> fn:sort($places, function($p) { $p!country, $p!city => collation-key() => 
> bin:not() } )
> 
> where bin:not is from http://expath.org/spec/binary#not
> 

Sorry, that's wrong. The empty string sorts first in ascending order, under 
this function it will still sort first in descending order. Need to do 
something a bit more subtle.

Michael Kay
Saxonica



_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk

Reply via email to