DekGenius.com
[ Team LiB ] Previous Section Next Section

1.3 Introduction to XML in .NET

Although many programming languages and environments have provided XML support as an add-on, .NET's support is integrated into the framework more tightly than most. The .NET development team decided to use XML extensively within the framework in order to meet its design goals. Accordingly, they built in XML support from the beginning.

The .NET Framework contains five main assemblies that implement the core XML standards. Table 1-1 lists the five assemblies, along with a description of the functionality contained in each. Each of these assemblies is documented in detail in Chapter 16 through Chapter 20.

Table 1-1. .NET XML assemblies

Assembly

Description

System.Xml

Basic XML input and output with XmlReader and XmlWriter, DOM with XmlNode and its subclasses, many XML utility classes

System.Xml.Schema

Constraint of XML via XML Schema with XmlSchemaObject and its subclasses

System.Xml.Serialization

Serialization to plain XML and SOAP with XmlSerializer

System.Xml.XPath

Navigation of XML via XPath with XPathDocument, XPathExpression, and XPathNavigator

System.Xml.Xsl

Transformation of XML documents via XSLT with XslTransform

In addition, the System.Web.Services and System.Data assemblies contain classes that interact with the XML assemblies. The XML assemblies used internally in the .NET Framework are also available for use directly in your applications.

For example, the System.Data assembly handles database operations. Its DataSet class provides a mechanism to transmit database changes using XML. But you can also access the XML generated by the DataSet and manipulate it just as you would any XML file, using classes in the System.Xml namespace.

Besides the .NET Framework's XML assemblies, there are several tools integrated into Visual Studio .NET and shipped with the .NET Framework SDK that can make your life easier when dealing with XML. These tools include xsd.exe, wsdl.exe, and disco.exe, among others.

There are also some tools shipped by Microsoft and other third parties that provide different ways to access and manipulate XML data. I describe some of them in Chapters 13 and 14.

.NET applications have access to system- and application-specific configuration files through the System.Configuration assembly. The System.Configuration assembly and the format of the XML configuration files, along with some examples of their use, are documented in Chapter 15.

As you can see, XML is deeply integrated into .NET. One entire layer of the .NET conceptual model shown in Figure 1-1 is devoted to XML. Although it shares the layer with data services, the XML and data assemblies are tightly integrated with each other.

    [ Team LiB ] Previous Section Next Section