Bug #1753

EXSLT extension function NPE when passed empty sequence

Added by Michael Kay almost 5 years ago. Updated almost 5 years ago.

EXSLT extensions
Start date:
Due date:
% Done:


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


In 9.5 an EXSLT extension function such as Date.difference() crashes with a NullPointerException when one of the arguments is supplied as an empty sequence.

The is a consequence of the fact that the conversion rules for calling reflexive extension functions have finally been aligned with the XPath 2.0 calling rules; an empty sequence as supplied argument is now mapped to a Java null. Previously, in line with the XPath 1.0 calling rules, an empty sequence was translated to a zero length string.

Most of the functions in the standard function library, where a string is expected, handle an empty sequence the same way as a zero-length string, and that seems the right thing to do here as well (we have to interpret the EXSLT specification in terms of the XPath 2.0 type system). But I think that it's for the Java code of the extension function to handle this, not for the calling mechanism itself.


#1 Updated by Michael Kay almost 5 years ago

  • Status changed from In Progress to Resolved

Fixed on the 9.5 and 9.6 branches by making all the EXSLT Date functions accept a null string as equivalent to a zero-length string.

#2 Updated by O'Neil Delpratt almost 5 years ago

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

Please register to edit this issue

Also available in: Atom PDF