Donate Share

Saxon XSLT and XQuery Processor

Tracker: Bugs

6 ClassCast failure with positional filter - ID: 655725
Last Update: Comment added ( mhkay )

A Java ClassCastException may occur when executing an
XPath filter expression using a predicate of the form
[position() < x] (where "<" represents any relational
operator other than "=", and x may be any expression
whose value depends on the XSLT context but not the
XPath context - for example, a variable reference. (It
doesn't fail if x is a constant).

Applies to 7.3 and 7.3.1 only.

The stack trace shows that the error (for both 7.3 and
7.3.1) is:

java.lang.ClassCastException:
net.sf.saxon.expr.RelationalExpression
at
net.sf.saxon.expr.FilterExpression.iterate(FilterExpression.java:328)


Reported by Paul Biron.

Source fix: change line 328 of
net.sf.saxon.expr.FilterExpression from

PositionRange pr = (PositionRange)filter;

to

PositionRange pr = (PositionRange)newFilter;

As a workaround, change the XPath expression from
[position()<$x] to [position()+1<$x+1].

Test case added: pos66

Source code fixed.




Michael Kay ( mhkay ) - 2002-12-18 13:34

6

Closed

None

Michael Kay

XSLT conformance

v7.3.1

Public


Comment ( 1 )

Date: 2003-02-17 12:20
Sender: mhkayProject Admin

Logged In: YES
user_id=251681

Fixed in 7.4


Attached File

No Files Currently Attached

Changes ( 2 )

Field Old Value Date By
status_id Open 2003-02-17 12:20 mhkay
close_date - 2003-02-17 12:20 mhkay