Package org.jaxen.function
Class LocalNameFunction
- java.lang.Object
-
- org.jaxen.function.LocalNameFunction
-
- All Implemented Interfaces:
Function
public class LocalNameFunction extends java.lang.Object implements Function
4.1
string local-name(node-set?)The local-name function returns the local part of the expanded-name of the node in the argument node-set that is first in document order. If the argument node-set is empty or the first node has no expanded-name, an empty string is returned. If the argument is omitted, it defaults to a node-set with the context node as its only member.
- Author:
- bob mcwhirter (bob @ werken.com)
- See Also:
- Section 4.1 of the XPath Specification
-
-
Constructor Summary
Constructors Constructor Description LocalNameFunction()Create a newLocalNameFunctionobject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectcall(Context context, java.util.List args)Returns the local-name of the specified node or the context node if no arguments are provided.static java.lang.Stringevaluate(java.util.List list, Navigator nav)Returns the local-name oflist.get(0)
-
-
-
Method Detail
-
call
public java.lang.Object call(Context context, java.util.List args) throws FunctionCallException
Returns the local-name of the specified node or the context node if no arguments are provided.- Specified by:
callin interfaceFunction- Parameters:
context- the context at the point in the expression where the function is calledargs- aListcontaining zero or one items- Returns:
- a
Stringcontaining the local-name - Throws:
FunctionCallException- ifargshas more than one item
-
evaluate
public static java.lang.String evaluate(java.util.List list, Navigator nav) throws FunctionCallExceptionReturns the local-name oflist.get(0)- Parameters:
list- a list of nodesnav- theNavigatorused to retrieve the local name- Returns:
- the local-name of
list.get(0) - Throws:
FunctionCallException- iflist.get(0)is not a node
-
-