ebv property

bool get ebv

The effective boolean value (EBV) per W3C XPath 3.1 ยง2.4.3.

Implementation

bool get ebv {
  final it = iterator;
  if (!it.moveNext()) return false;
  final first = it.current;
  if (first is XPathNode) return true;
  if (!it.moveNext()) {
    return first.effectiveBooleanValue;
  }
  throw XPathEvaluationException(
    XPathErrorCode.FORG0006,
    'Invalid EBV for sequence of length > 1',
  );
}