public interface IXPathFunction
Implementations of Function are functions which are used to evaluate a function-call within an XPath expression.
Lets say we want to implement a custom xpath function which gets a value of w3c node, the function name is getNodeValue(arg1) XPath function. Here is the code, which implements this function:
package com.collaxa.cube.xml.xpath.functions.xml;
public class GetNodeValue implements IXPathFunction
{
Object call(IXPathContext context, List args) throws XPathFunctionException
{
org.w3c.dom.Node node = (org.w3c.dom.Node) args.get(0);
return node.getNodeValue()
}
}
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
call(IXPathContext context, java.util.List args)
Call this XPath function.
|
java.lang.Object call(IXPathContext context, java.util.List args) throws XPathFunctionException
context - The context at the point in the expression when the function is called.args - List of arguments provided during the call of the function.XPathFunctionException