Parsing with the XmlTextReader Class

The XmlTextReader class is designed to provide fast access to streams of XML data in a forward-only and read-only manner. The reader verifies that the submitted XML is well-formed. It also performs a quick check for correctness on the referenced DTD, if one exists. In no case, though, does this reader validate against a schema or DTD. If you need more functionality (for example, validation), you must resort to other reader classes such as XmlNodeReader or XmlValidatingReader.

An instance of the XmlTextReader class can be created in a number of ways and from a variety of sources, including disk files, URLs, streams, and text readers. To process an XML file, you start by instantiating the constructor, as shown ...

Get Applied XML Programming for Microsoft® .NET 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.