A call to a function
ns is bound to a namespace of the form
java: is treated as a call of the static method
foo of the class with fully-qualified name
xmlns:file="java:java.io.File" file:createTempFile('xxe', '.tmp')
Hyphens in method names are removed with the character following the hyphen being upper-cased. Example:
is equivalent to:
A non-static method is treated like a static method with the this object as an additional first argument. Example:
A constructor is treated like a static method named
Overloading based on number of parameters is supported; overloading based on parameter types is not. Example, it is possible to invoke:
java.net.URL(java.lang.String spec) and
java.net.URL(java.net.URL context, java.lang.String spec) exist. It is not possible to invoke:
java.io.File(java.lang.String pathname) and
java.io.File(java.net.URI uri) exist.
Extension functions can return objects of arbitrary types which can then be passed as arguments to other extension functions.
Types are mapped between XPath and Java™ as follows:
|XPath type||Java™ type|
On return from an extension function, an object of type
com.xmlmind.xml.doc.XNode is also allowed and will be treated as a node-set; also any numeric type is allowed and will be converted to a number.