Package org.jaxen.function
Class IdFunction
java.lang.Object
org.jaxen.function.IdFunction
- All Implemented Interfaces:
Function
4.1 node-set id(object)
The id function returns a List
of all the elements in the context document that have an ID
matching one of a specified list of IDs. How an attribute is determined
to be of type ID depends on the navigator, but it normally requires that
the attribute be declared to have type ID in the DTD.
There should be no more than one element in any document with a certain ID. However, if there are multiple such elements--i.e. if there are duplicate IDs--then this function selects only the first element in document order with the specified ID.
- Author:
- Erwin Bolwidt (ejb @ klomp.org), Jérôme Nègre (jerome.negre @ e-xmlmedia.fr)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
IdFunction
public IdFunction()Create a newIdFunction
object.
-
-
Method Details
-
call
Returns a list of the nodes with the specified IDs.- Specified by:
call
in interfaceFunction
- Parameters:
context
- the context at the point in the expression when the function is calledargs
- a list with exactly one item which is either a string a node-set- Returns:
- a
List
containing the first node in document with each of the specified IDs; or an empty list if there are no such nodes - Throws:
FunctionCallException
- ifargs
has more or less than one item
-