Saxon.Api
Interface ExtensionFunction
-
public interface ExtensionFunction
This is an interface for simple external/extension functions. Users can implement this interface and register the implementation with the Processor; the function will then be available for calling from all queries, stylesheets, and XPath expressions compiled under this Processor.
Extension functions implemented using this interface are expected to be free of side-effects, and to have no dependencies on the static or dynamic context. A richer interface for extension functions is provided via the ExtensionFunctionDefinition class.
Method Summary |
|
---|---|
XdmValue | Call(XdmValue[] arguments) Method called at run time to evaluate the function. |
XdmSequenceType[] | GetArgumentTypes() Declare the type of the arguments |
QName | GetName() Return the name of the external function |
XdmSequenceType | GetResultType() Declare the result type of the external function |
Method Detail
Call
GetArgumentTypes
Declare the type of the arguments
Returns:
XdmSequenceType
objects, one for each argument to the function,
representing the expected types of the argumentsGetName
Return the name of the external function
Returns:
QName
GetResultType
Declare the result type of the external function
Returns:
Method called at run time to evaluate the function.
Parameters:
arguments
- The values of the arguments supplied in the XPath function call.Returns:
XdmValue
, representing the result of the extension function. (Note: in many cases it will be convenient to return anXdmAtomicValue
orXdmNode
, both of which are instances ofXdmValue
).