Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
INFO: Roadmap for Programming XML with the Pull-Model Parser in the .NET Framework
Article ID: 313816 - View products that this article applies to.
This article was previously published under Q313816
This article provides a roadmap for programming XML with the pull-model parser of the .NET Framework. To help with learning a Microsoft product or technology, roadmap articles provide links to useful information, including online documentation, Microsoft Knowledge Base articles, and white papers.
The pull model is implemented with classes based on the XmlReader class. XmlReader provides read access to XML data, and also enables you to skip data that you do not want. Note that the pull model has several advantages over the Simple API for XML (SAX) model, as explained at the following MSDN Web site:
Comparing XmlReader to SAX ReaderSAX is not implemented in .NET Framework, although it can be built by using the XmlReader class.
XML in the .NET Framework is implemented under the System.Xml namespace. The following classes are related with the pull model:
Reading XML with the XmlReaderFollow the links in the "See Also" section for samples of reading elements and attributes, validating against schemas, and skipping content that you do not want.
Typical steps in pull-model parsing include instantiating one of the XmlReader-based classes, based on the application's requirements, and reading the data after setting up the required properties.
For example, if performance is the key factor and no validation is required, XmlTextReader is a good choice. With the use of MoveToContent and Skip methods, it enables reading only the required data with improved performance. The following Knowledge Base articles provide code samples for programming XmlReader-related classes.
(http://support.microsoft.com/kb/301225/EN-US/ )HOW TO: Read XML from a File by Using Visual Basic .NET
(http://support.microsoft.com/kb/307548/EN-US/ )HOW TO: Read XML from a File by Using Visual C# .NET
(http://support.microsoft.com/kb/301232/EN-US/ )HOW TO: Read XML Data from a URL by Using Visual Basic .NET
(http://support.microsoft.com/kb/307643/EN-US/ )HOW TO: Read XML Data from a URL by Using Visual C# .NET
(http://support.microsoft.com/kb/315533/EN-US/ )HOW TO: Use DTDs, XDR, or XSD to Validate an XML Document in Visual Basic .NET
(http://support.microsoft.com/kb/307379/EN-US/ )HOW TO: Use DTDs, XDR, or XSD to Validate an XML Document in Visual C# .NET
(http://support.microsoft.com/kb/317463/EN-US/ )HOW TO: Validate XML Fragments Against an XML Schema in Visual Basic .NET
(http://support.microsoft.com/kb/318504/EN-US/ )HOW TO: Validate XML Fragments Against an XML Schema in Visual Basic .NET
(http://support.microsoft.com/kb/317595/EN-US/ )HOW TO: Validate an XML Document That Uses Multiple Schemas
301228You can also run XSL transformations (XSLT), query and modify XML data by using DOM, and serialize or deserialize XML data by using the System.Xml classes in .NET Framework. For more information, see the following Knowledge Base article:
(http://support.microsoft.com/kb/301228/EN-US/ )HOW TO: Read XML Data from a Stream in .NET Framework SDK
(http://support.microsoft.com/kb/313651/EN-US/ )INFO: Roadmap for XML in the .NET Framework
The DOM model is suited for applications that require random, read/write access to the data where memory consumption is not a factor. The pull model is suited for applications that require speed and memory conservation. Under many circumstances, the required solution may be a hybrid of these two models. For example, if part of a very large XML document needs to be manipulated, it may be efficient to use the pull model to read it, and then construct a DOM with only the data needed for additional modification.
http://support.microsoft.comYou have several options to find answers to your questions. You can search the Microsoft Knowledge Base, post your questions or share your experiences on Microsoft newsgroups, obtain the latest service packs and news about a specific product, or contact Microsoft Product Support.