public boolean effectiveBooleanValue(XPathContext context) throws XPathException {
// First create an iteration of the base sequence.
SequenceIterator base = sequence.iterate(context);
// Now test to see if some or all of the tests are true. The same
// logic is used for the SOME and EVERY operators
final boolean some = (operator==Token.SOME);
int slot = getLocalSlotNumber();
while (true) {
final Item it = base.next();
if (it == null) {
break;
}
context.setLocalVariable(slot, it);
if (some == action.effectiveBooleanValue(context)) {
base.close();
return some;
}
}
return !some;
}