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 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
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
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
used respectively for consuming and producing XML.
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 ...