* @throws net.sf.saxon.trans.XPathException
* if a dynamic error occurs during evaluation of the function.
*/
public Item evaluateItem(XPathContext context) throws XPathException {
FunctionItem f = (FunctionItem)getArguments()[0].evaluateItem(context);
ValueRepresentation val = SequenceExtent.makeSequenceExtent(
getArguments()[1].iterate(context));
int arg = 1;
if (getNumberOfArguments() == 3) {
arg = (int)((IntegerValue)getArguments()[2].evaluateItem(context)).longValue();
}
try {
return f.curry(arg, val);
} catch (XPathException e) {
e.maybeSetLocation(this);
e.maybeSetContext(context);
throw e;
}