Working with the XmlTextReader
The XmlTextReader is a fast, forward-only, read-only XML parser. Since the XmlTextReader is a forward-only reader, very little data is cached while parsing the XML stream. This allows for the XmlTextReader to parse a document while using a small footprint. The XmlTextReader does not provide any validation beyond checking the well-formedness of the XML. Since no validation is performed while reading the document, the XmlTextReader provides fast XML parsing.
The XmlTextReader throws an XmlException if it encounters an error parsing the XML stream. Although this allows you to catch the exception and continue parsing, this is not recommended. The state of the XmlTextReader is unpredictable after it has thrown an XmlException ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access