Project

Profile

Help

Bug #6059

closed

Bug on "-" castable to xs:duration

Added by Shuxin Li 10 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XPath conformance
Sprint/Milestone:
-
Start date:
2023-06-02
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
11, 12, trunk
Fix Committed on Branch:
11, 12, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java

Description

Tested on Saxon HE 12.2 from Java,

With xml document:

and XPath query: //P/@y castable as xs:duration

Saxon gives java.util.NoSuchElementException: Exception in thread "main" java.util.NoSuchElementException at java.base/java.util.StringTokenizer.nextToken(StringTokenizer.java:347) at net.sf.saxon.value.DurationValue.makeDuration(DurationValue.java:225) at net.sf.saxon.value.DurationValue.makeDuration(DurationValue.java:208) at net.sf.saxon.type.StringConverter$StringToDuration.convertString(StringConverter.java:607) at net.sf.saxon.type.StringConverter.convert(StringConverter.java:82) at net.sf.saxon.expr.CastableExpression.isCastable(CastableExpression.java:207) at net.sf.saxon.expr.CastableExpression.access$100(CastableExpression.java:29) at net.sf.saxon.expr.CastableExpression$CastableExpressionElaborator.lambda$elaborateForBoolean$0(CastableExpression.java:277) at net.sf.saxon.expr.elab.BooleanElaborator.lambda$elaborateForPull$0(BooleanElaborator.java:25) at net.sf.saxon.query.XQueryExpression.getExpressionIterator(XQueryExpression.java:404) at net.sf.saxon.query.XQueryExpression.iterator(XQueryExpression.java:381) at net.sf.saxon.s9api.XQueryEvaluator.evaluate(XQueryEvaluator.java:523) at Main.execute(Main.java:64) at Main.main(Main.java:20)

Process finished with exit code 1

Should return false.

Actions #1

Updated by Shuxin Li 10 months ago

Tested on Saxon HE 12.2 from Java,

With xml document:

and XPath query: //P/@y castable as xs:duration

Saxon gives java.util.NoSuchElementException:

Exception in thread "main" java.util.NoSuchElementException at java.base/java.util.StringTokenizer.nextToken(StringTokenizer.java:347) at net.sf.saxon.value.DurationValue.makeDuration(DurationValue.java:225) at net.sf.saxon.value.DurationValue.makeDuration(DurationValue.java:208) at net.sf.saxon.type.StringConverter$StringToDuration.convertString(StringConverter.java:607) at net.sf.saxon.type.StringConverter.convert(StringConverter.java:82) at net.sf.saxon.expr.CastableExpression.isCastable(CastableExpression.java:207) at net.sf.saxon.expr.CastableExpression.access$100(CastableExpression.java:29) at net.sf.saxon.expr.CastableExpression$CastableExpressionElaborator.lambda$elaborateForBoolean$0(CastableExpression.java:277) at net.sf.saxon.expr.elab.BooleanElaborator.lambda$elaborateForPull$0(BooleanElaborator.java:25) at net.sf.saxon.query.XQueryExpression.getExpressionIterator(XQueryExpression.java:404) at net.sf.saxon.query.XQueryExpression.iterator(XQueryExpression.java:381) at net.sf.saxon.s9api.XQueryEvaluator.evaluate(XQueryEvaluator.java:523) at Main.execute(Main.java:64) at Main.main(Main.java:20)

Process finished with exit code 1

Should return false.

Actions #2

Updated by Shuxin Li 10 months ago

The xml document seems to be disappearing from the previous two posts, it is

<P y="-"/>
Actions #3

Updated by Michael Kay 10 months ago

  • Category set to XPath conformance
  • Status changed from New to Resolved
  • Assignee set to Michael Kay
  • Priority changed from Low to Normal
  • Applies to branch 11, 12, trunk added
  • Fix Committed on Branch 11, 12, trunk added
  • Platforms .NET, Java added

Thanks for reporting it. Fixed on 11.x, 12.x and main branches. Test cases added to QT3 prod-CastExpr and prod-CastableExpr.

Actions #4

Updated by Shuxin Li 10 months ago

Thank you for the fix!

Actions #5

Updated by O'Neil Delpratt 9 months ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 12.3 added

Bug fix applied in the Saxon 12.3 maintenance release.

Actions #6

Updated by O'Neil Delpratt 9 months ago

  • Status changed from Closed to Resolved

Leaving this bug issue as resolved until resolved against Saxon 11.

Actions #7

Updated by Debbie Lockett 7 months ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 11.6 added

Bug fix applied in the Saxon 11.6 maintenance release.

Please register to edit this issue

Also available in: Atom PDF