Parsing with the .NET XmlReader Classes

Microsoft supplies three parsers that implement the XmlReader interface (see Figure 17.1):

  • XmlTextReader— The simplest and most straightforward XML parser in .NET XmlTextReader is a one-pass, forward-only parser. XmlTextReader doesn't support validation, cannot expand general entities, and default attributes aren't made available. However, although it has several downsides, the XmlTextReader is an extremely fast and efficient parser.

  • XmlValidatingReader— The XmlValidatingReader uses a parser like the XmlTextReader to add several extended features. First, the XmlValidatingReader validates the document against a Document Type Definition or XML Schema while the document is being parsed. In addition, it adds ...

Get Special Edition Using XML, Second Edition 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.