The require()
method asserts that the current event has a certain type, local name,
and namespace URI:
public void require(int type,
String namespaceURI,
String localName)
throws XmlPullParserException,
IOException
If the event does not have the right name and URI,
an XmlPullParserException
is thrown.
You can pass null for the local name or namespace URI, to match any local name/namespace URI.
This is useful for in-process validation.