Article ID: 313824 - Last Review: February 22, 2007 - Revision: 4.4 INFO: Roadmap for Programming XML with the DOM-Model Parser in the .NET FrameworkThis article was previously published under Q313824 On This PageSUMMARY This article provides a roadmap for programming XML with
the Document Object Model (DOM) 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. This article assumes a familiarity with the Worldwide Web Consortium (W3C) DOM standard. OverviewThe .NET Framework provides two ways to parse XML data:
XML in the .NET Framework is implemented under the System.Xml namespace. The following DOM-related classes provide ways to access, modify, and delete content in XML documents by using the DOM model:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcontypesofxmlnodes.asp
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcontypesofxmlnodes.asp)
Key Concepts and QuickStartsThe QuickStart tutorials are the fastest way to understand what the .NET Framework technology offers leading-edge developers. Following are links to relevant samples and documentation for DOM-model processing of XML.XML Document Object Model (DOM)
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconxmldocumentobjectmodeldom.asp)
XML Document Object Model (DOM) Hierarchy
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconxmldocumentobjectmodeldomhierarchy.asp)
Event Handling in an XML Document
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconeventhandlinginxmldocumentusingxmlnodechangedeventargs.asp)
How Do I...Load and use the XmlDocument?
(http://samples.gotdotnet.com/quickstart/howto/doc/xml/dominterfacexmldocument.aspx)
How Do I...Save XML with the XmlDocument?
(http://samples.gotdotnet.com/quickstart/howto/doc/xml/savexmldocument.aspx)
How Do I...Handle Events from XmlDocument?
(http://samples.gotdotnet.com/quickstart/howto/doc/xml/xmldocumentevent.aspx)
How Do I...Use an XmlNodeReader?
(http://samples.gotdotnet.com/quickstart/howto/doc/xml/xmlnodereader.aspx)
HOW TO ArticlesMicrosoft Knowledge Base HOW TO articles provide step-by-step instructions for accomplishing specific tasks.Typical steps in DOM-model processing include loading the XML data into an XmlDocument instance, manipulating or querying the data by using the DOM classes, and then persisting the results. The following Knowledge Base articles provide code samples for performing these activities: 317661
(http://support.microsoft.com/kb/317661/EN-US/
)
HOW TO: Load and Save XML by Using DOM in .NET Framework with Visual Basic .NET
317662
(http://support.microsoft.com/kb/317662/EN-US/
)
HOW TO: Load and Save XML by Using DOM in .NET Framework with Visual C# .NET
317663
(http://support.microsoft.com/kb/317663/EN-US/
)
HOW TO: Access XML Data Using DOM in .NET Framework with Visual Basic .NET
317664
(http://support.microsoft.com/kb/317664/EN-US/
)
HOW TO: Access XML Data Using DOM in .NET Framework with Visual C# .NET
317665
(http://support.microsoft.com/kb/317665/EN-US/
)
HOW TO: Modify XML Data by Using DOM in .NET Framework with Visual Basic .NET
317666
(http://support.microsoft.com/kb/317666/EN-US/
)
HOW TO: Modify XML Data by Using DOM in .NET Framework with Visual C# .NET
You can also run XSL transformations (XSLT),
validate XML documents against schemas, and serialize and deserialize XML data
by using the System.Xml classes in .NET Framework.
For additional information, click the article number below
to view the article in the Microsoft Knowledge Base: 313651
(http://support.microsoft.com/kb/313651/EN-US/
)
INFO: Roadmap for XML in the .NET Framework
GuidelinesYour choice of parser models may depend on your application's requirements. Note that the DOM-model parser loads the whole XML document into memory whereas the pull model loads one node at a time. The pull model consumes less memory but does not provide random access to data.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. TroubleshootingIf you experience problems and want assistance, the best place to start is at the Microsoft Product Support Services Web site:http://support.microsoft.com
(http://support.microsoft.com/)
You 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.
| Article Translations
|
Back to the top
