call method
Invokes the function item with the given arguments.
Implementation
@override
XPathSequence call(XPathContext context, List<XPathSequence> arguments) {
if (arguments.length != 1) {
throw XPathEvaluationException(
XPathErrorCode.FOAP0001,
'Maps expect exactly 1 argument, but got ${arguments.length}',
);
}
final key = arguments.single.atomize().firstOrNull;
if (key == null) {
throw XPathEvaluationException(
XPathErrorCode.XPTY0004,
'Map key cannot be empty sequence',
);
}
return get(key) ?? XPathSequence.empty;
}