Hi Andreas,

the fn:sort function [1] allows you to specify a dynamic collation string. Note, however, that you can only specify one collation string per sort operation, just as you cannot change any other sort property (such as e.g. the sort order) in a single sort.

Best,
Christian

[1] http://docs.basex.org/wiki/XQuery_3.1#fn:sort




Andreas Mixich <mixich.andreas@gmail.com> schrieb am Fr., 5. Okt. 2018, 22:46:
Hi,

this:

  for $i in $item
  let $lang := concat("?lang=", $item/@xml:lang/string())
  order by $i collation $lang
  return $i

does not work: "[XPST0003] Expecting quote, found '$'."
Any way to do this dynamically?

Wouldn't

  order by $i collation $item/@xml:lang/string()

make sense?

--
Goody Bye, Minden jót, Mit freundlichen Grüßen,
Andreas Mixich