checkValidType static method

void checkValidType(
  1. XmlNode node,
  2. Iterable<XmlNodeType> types
)

Ensure that node is of one of the provided types.

Implementation

static void checkValidType(XmlNode node, Iterable<XmlNodeType> types) {
  if (!types.contains(node.nodeType)) {
    throw XmlNodeTypeException(
      'Got ${node.nodeType}, but expected one of ${types.join(', ')}',
      node: node,
      types: types,
    );
  }
}