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

Writing and Reading XML Documents

The easiest and quickest means of writing and reading XML documents is via the XmlTextWriter and XmlTextReader classes. I'll first explain how to create and write XML documents and then how to read those documents—parsing for the desired node types and values. Once that is done, you'll see a demo illustrating how to use these classes in writing and reading a simple XML file containing book-detail information.

Writing XML Documents

The first thing to understand about the XmlTextWriter class is that it encapsulates a fast, noncached, forward-only way of generating streams or files containing XML data that conforms to the W3C standards for XML. Therefore, it can only be used to write from beginning to end an XML ...

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