mode="#current" within a function
The Saxon XSLT and XQuery processor, developed by Saxonica
Brought to you by:
mhkay
Saxon throws a NullPointerException if an apply-templates instruction specifying mode="#current" is used within a stylesheet function. The specification states (and erratum XT.E19 amplifies) that within a function, the current mode is the default (unnamed) mode. This bug is present in 9.2 and all known previous releases. A patch is being raised for the 9.1 and 9.2 branches only.
Correction: the code works correctly in Saxon 9.1 and previous releases.
Fixed in 9.2.1.1