Accessing an XML File

Access and Manipulate XML Data: Access an XML file by using the Document Object Model (DOM) and an XmlReader.

The most basic thing you can do with an XML file is open it and read it to find out what the file contains. The .NET Framework offers both unstructured and structured ways to access the data within an XML file. That is, you can treat the XML file either as a simple stream of information or as a hierarchical structure composed of different entities, such as elements and attributes.

In this section of the chapter you'll learn how to extract information from an XML file. I'll start by showing you how you can use the XmlReader object to move through an XML file, extracting information as you go. Then you'll see how other ...

Get MCAD/MCSD Training Guide (70-320): Developing XML Web Services and Server Components with Visual C#™ .NET and the Microsoft .NET Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.