|Modifier||Constructor and Description|
|Modifier and Type||Method and Description|
Evaluate this function call at run-time
Copy local data from one copy of the function to another.
Supply static context information.
effectiveBooleanValue, getDefinition, getStreamingImplementation, rewrite, setDefinition
public void supplyStaticContext(StaticContext env, int locationId, Expression arguments) throws XPathException
This method is called during compilation to provide information about the static context in which the function call appears. If the implementation of the function needs information from the static context, then it should save it now, as it will not be available later at run-time.
The implementation also has the opportunity to examine the expressions that appear in the arguments to the function call at this stage. These might already have been modified from the original expressions as written by the user. The implementation should not modify any of these expressions.
The default implementation of this method does nothing.
env- The static context in which the function call appears. The method must not modify the static context.
locationId- An integer code representing the location of the call to the extension function in the stylesheet; can be used in conjunction with the locationMap held in the static context for diagnostics
arguments- The XPath expressions supplied in the call to this function. The method must not modify this array, or any of the expressions contained in the array. @throws net.sf.saxon.trans.XPathException if the implementation is able to detect a static error in the way the function is being called (for example it might require that the types of the arguments are consistent with each other).
XPathException- if the implementation is able to detect a static error in the way the function is being called (for example it might require that the types of the arguments are consistent with each other).
public void copyLocalData(ExtensionFunctionCall destination)
protected Evaluate.PreparedExpression prepareExpression(String exprText, NodeInfo namespaceOrigin, String functionName, XPathContext context) throws XPathException
public Sequence call(XPathContext context, Sequence arguments) throws XPathException
context- The XPath dynamic evaluation context
arguments- The values of the arguments to the function call. Each argument value (which is in general a sequence) is supplied in the form of an iterator over the items in the sequence. If required, the supplied sequence can be materialized by calling, for example,
new SequenceExtent(arguments[i]). If the argument is always a singleton, then the single item may be obtained by calling
arguments[i].next(). The implementation is not obliged to read all the items in each
SequenceIteratorif they are not required to compute the result; but if any SequenceIterator is not read to completion, it is good practice to call its close() method.
SingletonIterator. If the result is an empty sequence, the method should return
XPathException- if a dynamic error occurs during evaluation of the function. The Saxon run-time code will add information about the error location.
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.