Closed ymor closed 5 years ago
Nice find! I think something may go awry with the atomization step that runs before the comparison. I'll look into this next Friday!
I see the problem(s):
We have a bug in generalCompare
, the typecasting of xs:untypedAtomic
s is wrong. In essence, if one of the operands is an untypedAtomic, the other one is made one too, resulting in two untypedAtomics. This is wrong. See https://www.w3.org/TR/xpath-31/#doc-xpath31-GeneralComp, 2.b.iv.
This fault causes us to cast both operands to xs:untypedAtomics
, stringifying them. The stringification causes the timezone to be added to the result of the current-date() function. this makes them unequal.
I believe that the timezone part is the correct behaviour (https://www.w3.org/TR/xpath-functions-31/#func-current-date).
Thanks for filing this issue! I just merged it and this will be released with the next release, probably somewhere this week.
Working example: https://xpath.playground.fontoxml.com/?mode=0&variables=%7B%7D&xml=+%3C%21--Update+to+actual+current+date+--%3E%0A%3CcurrentDate%3E2019-05-01%3C%2FcurrentDate%3E&xpath=+current-date%28%29+%3D+%2FcurrentDate%0A
Not working example: https://xpath.playground.fontoxml.com/?mode=0&variables=%7B%7D&xml=+%3C%21--Update+to+actual+current+date+--%3E%0A%3CcurrentDate%3E2019-05-01%3C%2FcurrentDate%3E&xpath=%2FcurrentDate+%3D+current-date%28%29