}
Function function =
context.getRootContext().getFunction(functionName, parameters);
if (function == null) {
throw new JXPathFunctionNotFoundException("No such function: "
+ functionName + Arrays.asList(parameters));
}
Object result = function.invoke(context, parameters);
return result instanceof NodeSet ? new NodeSetContext(context,
(NodeSet) result) : result;