"A sequence of more than one item is not allowed as the " +
role.getMessage(), role.getErrorCode(), context);
}
result = item;
} else {
Value value = ((NodeInfo)item).atomize();
found += value.getLength();
if (found > 1) {
typeError(
"A sequence of more than one item is not allowed as the " +
role.getMessage(), role.getErrorCode(), context);
}
result = value.itemAt(0);
}
}
if (found == 0 && !allowEmpty) {
typeError("An empty sequence is not allowed as the " +
role.getMessage(), role.getErrorCode(), null);