This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26832 - [XP31] 3.7.2 General Comparisons
Summary: [XP31] 3.7.2 General Comparisons
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XPath 3.1 (show other bugs)
Version: Working drafts
Hardware: SGI Windows NT
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL: https://www.w3.org/XML/Group/qtspecs/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-17 10:08 UTC by Tim Mills
Modified: 2015-07-07 15:55 UTC (History)
2 users (show)

See Also:


Attachments

Description Tim Mills 2014-09-17 10:08:50 UTC
The problem here isn't specific to XPath 3.1, but it might be a good time to clear this issue up now...

In 3.7.2 General Comparisons, Step 4 says:

"The result of the comparison is true if and only if there is a pair of atomic values, one in the first operand sequence and the other in the second operand sequence, that have the required magnitude relationship. Otherwise the result of the comparison is false... "

This suggests that possible outcomes are only true or false.  However, the paragraph then goes on to mention one error condition.

So possible outcomes are:

true:  e.g. true() = true()
false: e.g. true() = false()
FORG0006: e.g. true() = xs:yearMonthDuration('P1999Y')
FORG0001: e.g. xs:yearMonthDuration('P1999Y') = xs:untypedAtomic('untyped')
XPTY0004: e.g. xs:yearMonthDuration('P1999Y') = xs:dateTime('2013-01-01T00:00:00Z')

(the last of which being determined statically).

The discrepancy between the two statements suggests that it might be permissible to ignore all errors and return only true or false.

A similar problem occurs in the test describing comparison when XPath 1.0 compatibility mode is false.
Comment 1 Jonathan Robie 2014-09-23 17:25:56 UTC
I will change this to:

Otherwise the result of the comparison is false or an error.
Comment 2 Michael Kay 2015-07-06 08:31:06 UTC
The change promised in comment #1 does not appear in the current draft specification.
Comment 3 Josh Spiegel 2015-07-07 15:55:00 UTC
Previously, it was only changed in XPath in the case where XPath compatibility mode is true.