Bug #6059
closed![Author: Shuxin Li](https://www.gravatar.com/avatar/02bc034018dc3b454ee3e13d8bc21198?rating=PG&size=50&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
![Assignee: Michael Kay](https://www.gravatar.com/avatar/db6526d63053f09b62e52c2da8b2230a?rating=PG&size=22&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
Bug on "-" castable to xs:duration
100%
Description
Tested on Saxon HE 12.2 from Java,
With xml document:
and XPath query: //P/@y castable as xs:durationSaxon 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.
Updated by Shuxin Li about 1 year 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.
Updated by Shuxin Li about 1 year ago
The xml document seems to be disappearing from the previous two posts, it is
<P y="-"/>
Updated by Michael Kay about 1 year 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.
Updated by O'Neil Delpratt about 1 year 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.
Updated by O'Neil Delpratt about 1 year ago
- Status changed from Closed to Resolved
Leaving this bug issue as resolved until resolved against Saxon 11.
Updated by Debbie Lockett about 1 year 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