EXSLT extension function NPE when passed empty sequence
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.