The compare function takes two strings as arguments and compares them for equality and alphabetically. If string1 is alphabetically less than string2 (for example the two string are "A" and "B"), then the function returns -1. If the two strings are equal (for example, "A" and "A"), the function returns 0. If string1 is greater than string2 (for example, "B" and "A"), then the function returns 1.
This variant of the function uses the default collation, which is Unicode. Another variant of this function exists where you can supply the collation as argument.
XQuery, XSLT 2.0, XSLT 3.0.
The first input string.
The second input string.