Project

Profile

Help

Bug #3212

closed

NullPointerException evaluating if (A = B to C)

Added by Michael Kay about 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XPath conformance
Sprint/Milestone:
-
Start date:
2017-04-28
Due date:
% Done:

100%

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

Description

A stylesheet contains the logic

<xsl:variable name="range" select="f:eval(@a) to f:eval(@b)"/>
<xsl:if test="f:eval(X) = $range">...</xsl:if>

Saxon successfully identifies the opportunity to turn this into an IntegerRangeTest (A = B to C) which is evaluated essentially as (A>=B and A<=C).

However, it seems that the optimized code fails to take account of the fact that f:eval() is capable of returning an empty sequence, in which case the boolean expression should evaluate to false.

This code has been in the product for a long time!

Please register to edit this issue

Also available in: Atom PDF