Extensibility mechanisms

For reflexive calls on Java extension functions, a new option is provided that allows void instance-level methods (typically, setter methods) to return the instance to which they are applied, rather than returning an empty sequence. This has two benefits: it allows use of the XPath 3.1 arrow operator for function chaining (for example, let $x := c:new() => c:setX(22) => c:setY(55)), and it reduces the risk of mis-optimization by making it easier to use such methods in such a way that there is a functional dependency on the result of the method.

For compatibility reasons the new feature is optional. It is invoked by adding ?void=this to the class name in the namespace declaration, for example xmlns:DateFormat = "java.text.DateFormat?void=this".