XPathNodeSet constructor
Constructs a new node-set from nodes
. By default we assume that the
input require sorting (isSorted = false
) and deduplication (isUnique = false
).
Implementation
factory XPathNodeSet(
Iterable<XmlNode> nodes, {
bool isSorted = false,
bool isUnique = false,
}) {
if (!isUnique) nodes = nodes.toSet();
final list = nodes.toList(growable: false);
if (!isSorted || !isUnique) {
list.sort((a, b) => a.compareNodePosition(b));
}
return XPathNodeSet._(list);
}