Project

Profile

Help

Bug #3905

closed

Incorrect casting of xs:untypedAtomic in XDMString.compareTo()

Added by John Lumley over 5 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2018-09-15
Due date:
% Done:

100%

Estimated time:
Applies to JS Branch:
1.0, Trunk
Fix Committed on JS Branch:
1.0, Trunk
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

In Atomic.js XDMString.compareTo() casts strings that are untypedAtomic to the other operand type. This is in line with the semantics of General Comparisons for operators such as <. However, evaluation of gc already performs that action in such cases and resolution of vc precasts an untypedAtomic to a string, so this operation should be unnecessary.

QT3 test sort-array-025 fails because in

array:sort([xs:untypedAtomic('2015-06-12+01:00'),current-date()]

the comparison uses the XDMString.compareTo(xs:date) and hence incorrectly casts the string to xs:date, avoiding the incomparability error check, as would fn:sort() in such circumstances. Thus the cast in XDMString.compareTo must not perform that cast. As far as I can see all necessary GeneralComparisons or ValueComparisons do necessary precasting.

Actions #1

Updated by John Lumley over 5 years ago

  • Applies to JS Branch 1.0, Trunk added
Actions #2

Updated by Norm Tovey-Walsh about 3 years ago

  • Status changed from Resolved to Closed
Actions #5

Updated by Debbie Lockett about 3 years ago

  • % Done changed from 0 to 100
  • Fixed in JS Release set to Saxon-JS 1.2.0
  • Fix Committed on JS Branch 1.0, Trunk added

Very belatedly marking fixed in Saxon-JS 1.2.0 maintenance release.

Please register to edit this issue

Also available in: Atom PDF Tracking page