return _returnType;
}
public Sequence eval(Sequence<? extends Item> contextSeq, ValueSequence argv, DynamicContext dynEnv)
throws XQueryException {
Item src = argv.getItem(0);
Item fromIt = argv.getItem(1);
final int from = ((XNumber) fromIt).getNumber().intValue();
final int arglen = argv.size();
if(arglen == 2) {
return new FilterExpr.Sliced(src, from, Integer.MAX_VALUE, dynEnv, getReturnType());
}
Item lengthIt = argv.getItem(2);
final int length = ((XNumber) lengthIt).getNumber().intValue(); //TODO exceeds Integer.MAX
if(length < 1) {
return ValueSequence.EMPTY_SEQUENCE;
}
return new FilterExpr.Sliced(src, from, from + length - 1, dynEnv, getReturnType());