Hi Joe,
Choosing collation URIs can be confusing. The spec says [1]:
“If the fallback parameter is omitted or takes the value yes [in the URI], and if the collation URI is well-formed according to the rules in this section, then the implementation must accept the collation URI, and should use the available collation that most
closely reflects the user’s intentions.”
This means that BaseX chooses a standard collation implementation if ICU is not present, and if the URI does not contain 'fallback=no'.
However, this does not fully explain the surprising behavior that you observed. It was caused by a wrong interpretation of the 'compare' argument. I have improved this in the latest snapshot [2]. To be honest, this is still work in progress, as the spec offers
few information on the details. The safest choice is to add the fallback behavior to the URI, and omit the second parameter:
let $uri := `http://www.w3.org/2013/collation/UCA?numeric=yes&fallback=no`
return if (collation-available($uri)) then (
("d2", "d12") => sort($uri)
) else (
"UCA collation not present"
)
Hope this helps,
Christian