Bug #1473

java.lang.AssertionError: Value of variable is undefined (null). Variable reference $saxon:current24880015

Added by Michael Kay over 9 years ago. Updated over 7 years ago.

XSLT conformance
Start date:
Due date:
% Done:


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


A NullPointerException (wrapped as an AssertionError) occurs when referencing the current() function inside the predicate of a template match pattern.

Test case supplied by Olivier Jeulin on support (at) on 2012-04-10.

Reported against; bug still present in current development branch.


#1 Updated by Michael Kay over 9 years ago

This one is proving quite troublesome. It is caused by using current() in both branches of a union pattern. The calls to current() are replaced by variable references, which refer to a variable binding that is established on entry to pattern.match(), but this mechanism is not coping with the way that a union pattern is split into two separate patterns to handle the XSLT requirement that a template rule with a union pattern is equivalent to two separate template rules, each using one branch of the pattern. The bug has almost certainly been in the product "for ever".

#2 Updated by Michael Kay over 9 years ago

A patch is now committed and tested on both the 9.4 and 9.5 branches.

#3 Updated by Michael Kay about 9 years ago

  • Status changed from New to Resolved

#4 Updated by O'Neil Delpratt over 7 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to

Bug fix applied in Saxon maintenance release

Please register to edit this issue

Also available in: Atom PDF