while (iter.hasNext()) { String id = StringFunction.evaluate(iter.next(), nav); nodes.addAll( evaluate( contextNodes, id, nav ) );
/** * Returns a list of the nodes with the specified IDs. * * @param context the context at the point in the * expression when the function is called * @param args a list with exactly one item which is either a string * a node-set * * @return a <code>List</code> containing the first node in document * with each of the specified IDs; or * an empty list if there are no such nodes * * @throws FunctionCallException if <code>args</code> has more or less than one item */ public Object call(Context context, List args) throws FunctionCallException { if ( args.size() == 1 ) { return evaluate( context.getNodeSet(), args.get(0), context.getNavigator() ); } throw new FunctionCallException( "id() requires one argument" ); }