Extensibility mechanisms

Changes have been made to the rules for calling Java extension functions.

The rules for selecting a Java extension function have been changed to align better with the standard function calling rules in XPath 2.0. The main impact is that fewer implicit type conversions are supported for the arguments. For example, if the Java method expects an integer, then it is not acceptable to supply a string. Similarly, if the Java method expects a single item, then you cannot supply a sequence of several items.

In addition, it must now be possible to identify a Java method uniquely at compile time, based on the static types of the supplied arguments. If there are several Java methods with the same name in the target class, it may be necessary to cast the supplied argument explicitly to ensure that enough information about the type of the argument is available statically.

If difficulties arise in binding extension functions, the -TJ option on the command line gives useful diagnostics.