Donate Share

Saxon XSLT and XQuery Processor

Tracker: Bugs

5 evaluateItem on non-singleton - ID: 690736
Last Update: Settings changed ( mhkay )

The symptom is the crash:

java.lang.IllegalStateException: evaluateItem called on
non-singleton variable reference at
net.sf.saxon.expr.VariableReference.evaluateItem(VariableReference.java:202
)
at
net.sf.saxon.expr.Expression.lazyEvaluate(Expression.java:161)
at
net.sf.saxon.expr.LetExpression.iterate(LetExpression.java:45)

This occurs when the Saxon optimizer rewrites an
expression that includes a filter containing a
subexpression whose value is independent of the
context, and is potentially multi-valued, for example

$a[xyz = $nnn/@a]

where $nnn can return more than one item.

Occurs with Saxon 7.4 only.

Reported by Steve Muench.

A circumvention is to make the subexpression appear to
depend on the context, by changing it to:

$a[xyz = ./$nnn/@a]

Source code fixed - add the following method to
net.sf.saxon.expr.LetExpression.java:

public RequiredType getRequiredType() {
return new RequiredType(sequence.getItemType(),
Type.ANY_ITEM, Cardinality.ZERO_OR_MORE);
}

Original repro is in users/muench/saxonbug, not yet
added to regression test suite.


Michael Kay ( mhkay ) - 2003-02-21 16:15

5

Closed

Fixed

Michael Kay

XPath conformance

v7.4

Public


Comments

No follow-up comments have been posted.

Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
status_id Open 2003-06-27 18:58 mhkay
resolution_id None 2003-06-27 18:58 mhkay
close_date - 2003-06-27 18:58 mhkay