Project

Profile

Help

Bug #4508

closed

ClassCastException on Saxon 10

Added by Gunther Rademacher about 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2020-03-30
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
10
Fix Committed on Branch:
10
Fixed in Maintenance Release:
Platforms:

Description

On Saxon 10, this throws a ClassCastException:

declare variable $rows := (
  <row>a</row>,
  <row>b</row>
);
declare function local:f()
{
  let $row := $rows[2]
  return 'exists' [$row]
};
local:f()

The stacktrace is

java.lang.ClassCastException: net.sf.saxon.tree.tiny.TinyElementImpl cannot be cast to net.sf.saxon.value.NumericValue
        at net.sf.saxon.expr.SubscriptExpression.evaluateItem(SubscriptExpression.java:151)
        at net.sf.saxon.expr.Expression.process(Expression.java:940)
        at net.sf.saxon.expr.instruct.UserFunction.process(UserFunction.java:665)
        at net.sf.saxon.expr.UserFunctionCall.process(UserFunctionCall.java:601)
        at net.sf.saxon.query.XQueryExpression.run(XQueryExpression.java:453)
        at net.sf.saxon.s9api.XQueryEvaluator.run(XQueryEvaluator.java:369)
        at net.sf.saxon.Query.runQuery(Query.java:895)
        at net.sf.saxon.Query.doQuery(Query.java:423)
        at net.sf.saxon.Query.main(Query.java:97)

Related issues

Has duplicate Saxon - Bug #5590: ClassCastException (variable declaration with context item reference)DuplicateMichael Kay2022-07-05

Actions

Please register to edit this issue

Also available in: Atom PDF