If an extenstion function has an argument of type ExpressionContext,
it can gain access to the current node of an XPath expression context.
Example:
public class MyExtenstionFunctions {
public static String objectType(ExpressionContext context){
Object value = context.getContextNodePointer().getValue();
if (value == null){
return "null";
}
return value.getClass().getName();
}
}
You can then register this extension function using a
ClassFunctionsClassFunctions object and call it like this: