XmlReader

The .NET Framework does not provide a SAX parser implementation. While the SAX API is the de facto standard for event-driven XML processing in Java, Microsoft has chosen a fundamentally different approach for .NET.

As a SAX parser processes XML input, application callbacks are used to signal events such as the start or end of an XML element; this approach is considered a push model.

The .NET approach, based on the abstract System.Xml.XmlReader class, provides a pull model, wherein the application invokes XmlReader members to control how and when the parser progresses through the XML document. This is analogous to a forward-only cursor that provides read-only access to the XML source. As with SAX, XmlReader is a noncaching parser.

The .NET ...

Get C# for Java Developers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.