Skip to content
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

893 fn:compare: Support for arbitrary atomic types #909

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

ChristianGruen
Copy link
Contributor

No description provided.

@ChristianGruen ChristianGruen added the Tests Needed Tests need to be written or merged label Dec 17, 2023
Copy link
Contributor

@michaelhkay michaelhkay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A very pendantic reader might say that the sentence "If both $value1 and $value2 are instances of one of xs:string, xs:anyURI or xs:untypedAtomic" is ambiguous; it could mean that they both have to be instances of the same one of these three types. The phrase "one of" does not help to remove the ambiguity. A possible resolution would be to define that a value is "string-like" if it is an instance of one of these three types; we could use this defined term in quite a few places.

It's not a good idea to convert untypedAtomic to the type of the other operand. It leads to non-transitivity, which makes the function unsuitable as a callback to fn:sort.

I think base64Binary and hexBinary should be mutually comparable.

@ChristianGruen
Copy link
Contributor Author

Revised, thanks.

A very pendantic reader might say that the sentence "If both $value1 and $value2 are instances of one of xs:string, xs:anyURI or xs:untypedAtomic" is ambiguous; it could mean that they both have to be instances of the same one of these three types. The phrase "one of" does not help to remove the ambiguity. A possible resolution would be to define that a value is "string-like" if it is an instance of one of these three types; we could use this defined term in quite a few places.

I’ve now listed the corresponding types twice, once for each input value; same for xs:base64Binary and xs:hexBinary, which I have combined.

For pedantic readers, we might also need to rephrase the rules of fn:min and fn:max, which currently read:

If each value is an instance of one of the types xs:string or xs:anyURI, then all the values are cast to type xs:string.

Copy link
Contributor

@michaelhkay michaelhkay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example "compare(xs:date('2001-01-01'), xs:untypedAtomic('2001-01-01'))" needs to change.

@ndw
Copy link
Contributor

ndw commented Jan 9, 2024

The CG agreed to merge this PR at meeting 060

@ndw ndw merged commit 2217b60 into qt4cg:master Jan 9, 2024
2 checks passed
@ChristianGruen ChristianGruen deleted the 893 branch January 10, 2024 11:54
@ChristianGruen ChristianGruen removed the Tests Needed Tests need to be written or merged label Jan 16, 2024
@michaelhkay michaelhkay added Tests Added Tests have been added to the test suites Completed PR has been applied, tests written and tagged, no further action needed labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Completed PR has been applied, tests written and tagged, no further action needed Tests Added Tests have been added to the test suites
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants