O'Reilly logo

Extending MFC Applications with the .NET Framework by Nishant Sivakumar, Tom Archer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The DOM and the XmlDocument Class

As the XmlDocument class is an encapsulation of the DOM (Document Object Model), let's first get a basic overview of what the DOM is and how the capabilities it provides compare with what you've learned up to this point.

The DOM is an in-memory representation of an XML document that allows you to read, edit, and save XML data. However, unlike the XmlTextWriter/XmlTextReader class pair, the DOM doesn't view the XML data in a linear fashion. Instead, when the DOM loads an XML document, the document is parsed, and the data is represented as a tree of related nodes. As an example, take a look the following, more expanded, version of our earlier BookDetail XML document:

 <?xml version="1.0"?> <BookDetail> <Book ISBN="032117352X"> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required