isSubtypeOf method

  1. @override
bool isSubtypeOf(
  1. XPathType other
)
override

Whether this type is equal to or a subtype of other.

Implementation

@override
bool isSubtypeOf(XPathType other) {
  if (identical(this, other) || this == other) return true;
  if (other == xsItem || other == xsSequence) return true;
  if (other is XPathSequenceType) {
    return itemType.isSubtypeOf(other.itemType) &&
        cardinality.isSubtypeOf(other.cardinality);
  }
  if (cardinality == XPathCardinality.exactlyOne) {
    return itemType.isSubtypeOf(other);
  }
  return false;
}