[xquery-talk] fn:sort: sort for strings in descending order

Michael Kay mike at saxonica.com
Fri Dec 4 02:21:20 PST 2015

> PS. The composite sort key is another tough cookie to crumble. I feel
> challenged.

Because fn:sort produces a stable sort, one can always go back to the old punched-card technique of doing multiple sorts, in minor-to-major key order:

$places => sort(function($x){$x!city}) => reverse() => sort(function($x){$x!country})

Michael Kay

More information about the talk mailing list