compare($string-1 as xs:string?, $string-2 as xs:string?) xs:integer?
Returns the collatable comparison between $string-1 and $string-2, -1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal to $string-2, 1 if $string-1 is superior to $string-2. If either comparand is the empty sequence, the empty sequence is returned. Please remember to specify the collation in the context or use the three argument version if you don't want the system default.
$string-1
The first string
$string-2
The second string
Returns -1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal to $string-2, 1 if $string-1 is superior to $string-2. If either comparand is the empty sequence, the empty sequence is returned.
compare($string-1 as xs:string?, $string-2 as xs:string?, $collation-uri as xs:string) xs:integer?
Returns the collatable comparison using $collation-uri between $string-1 and $string-2, -1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal to $string-2, 1 if $string-1 is superior to $string-2. If either comparand is the empty sequence, the empty sequence is returned. The third argument $collation-uri is relative so you only need to specify the last part of a valid full collation-uri, e.g. '?lang=sv-SE', 'lang=sv-SE;strength=primary;decomposition=standard' or 'swedish'.
$string-1
The first string
$string-2
The second string
$collation-uri
The relative collation URI
Returns -1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal to $string-2, 1 if $string-1 is superior to $string-2. If either comparand is the empty sequence, the empty sequence is returned.