Skip to Main Content
C# in a Nutshell, Second Edition
book

C# in a Nutshell, Second Edition

by Peter Drayton, Ben Albahari, Ted Neward
August 2003
Intermediate to advanced content levelIntermediate to advanced
928 pages
32h 1m
English
O'Reilly Media, Inc.
Content preview from C# in a Nutshell, Second Edition

Chapter 8. XML I/O

XML has, for better or worse, taken the programming industry by storm. It has become, in a matter of a few short years, the de facto standard for exchanging data between heterogeneous systems as well as the format of choice for storing just about any kind of data. The .NET runtime uses XML as part of its configuration, and the .NET Framework contains a redesigned set of classes for accessing, consuming, producing, and transforming XML documents.

This chapter introduces the built-in support for XML, explains the relationships between XML and the I/O system in general, demonstrates the consumption and production of XML documents in both node-based and Infoset-based forms, highlights the use of XPath, and finally explores XSLT. All types within this namespace come from the System.Xml and System.Xml.XPath namespaces and are contained in the System.Xml.dll assembly. (When using these types, remember to reference the assembly either at the command line or from Visual Studio’s project dialogs.)

Accessing XML Documents

Like the I/O mechanism described in Chapter 10, the XML libraries in the .NET FCL follow a pattern of an “abstract base class with concrete backing store implementation classes.” The two abstract base classes themselves are XmlReader and XmlWriter, used respectively for consuming and producing XML.

XmlReader

The XmlReader class, as its name implies, provides the ability to consume XML documents. It is an abstract base class, intended to be subclassed for working ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# in a Nutshell

C# in a Nutshell

Ben Albahari, Ted Neward, Peter Drayton
C# 7.0 in a Nutshell

C# 7.0 in a Nutshell

Joseph Albahari, Ben Albahari
C# Cookbook, 2nd Edition

C# Cookbook, 2nd Edition

Jay Hilyard, Stephen Teilhet
C# Cookbook

C# Cookbook

Joe Mayo

Publisher Resources

ISBN: 0596005261Catalog PageErrata