Use the higher-order sort() function in 3.1. This gives you much more flexibility in computing a sort key, and the sort key can be any sequence. The only limitation is it's tricky if you want some components (but not all) to be in descending order.
Michael Kay
Saxonica
I am writing an XQuery to validate whether "records" (parent nodes) are unique based on a number of child elements and their attributes (like primary keys in relational). I do not know these "keys" in advance however, as they are generated from a query on another document. So sometimes I have only two "keys", but sometimes 10.
"order by" uses a list of comma-separated values, but as I don't know these values in advance, ...
$keys := ... (: returns a sequence :)
...
for ...
order by $keys (: throws an error of course at it expects a list of comma-separated values :)
Any tips how this can be done?
Many thanks in advance,
Jozef
_______________________________________________
http://x-query.com/mailman/listinfo/talk