-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fn:compare: Support for arbitrary atomic types #893
Comments
We chose to expose |
I’d probably have written But maybe it's good to motivate people to learn more about the internals of the language this way, and to give experts direct access to it. |
Accepted and merged (#909). |
Inspired by #866:
We should extend
fn:compare
to support arbitrary atomic types. The comparison rules…fn:numeric-compare
for numbers, andop:
functions for the remaining types.For example, the rule for dates would be:
0
is returned ifop:date-equal(A, B)
istrue
,-1
is returned ifop:date-less-than(A, B)
istrue
,1
is returned otherwise.Some types will be rejected (
xs:duration
,xs:QName
,xs:NOTATION
, Gregorian types).In addition, I would vote for making
fn:numeric-compare
andfn:atomic-equal
private. I don’t see a benefit to expose them; I rather expect people to be confused.The text was updated successfully, but these errors were encountered: