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 ...

Get Microsoft® .NET Compact Framework Kick Start now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.