Project

Profile

Help

Bug #1753

closed

EXSLT extension function NPE when passed empty sequence

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
EXSLT extensions
Sprint/Milestone:
-
Start date:
2013-04-30
Due date:
% Done:

100%

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

Description

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.

Please register to edit this issue

Also available in: Atom PDF