Chapter 26: Manipulating XML


Overview

XML plays a significant role in the .NET Framework. Not only does the .NET Framework allow you to use XML in your application, but the .NET Framework itself uses XML for configuration files and source code documentation, as do SOAP, Web services, and ADO.NET, to name just a few.

To accommodate this extensive use of XML, the .NET Framework includes the System.Xml namespace. This namespace is loaded with classes that can be used for the processing of XML, and many of these classes are discussed in this chapter.

This chapter discusses how to use the XmlDocument class, which is the implementation of the Document Object Model (DOM), as well as what .NET offers as a replacement for SAX (the XmlReader and XmlWriter classes). It also discusses the class implementations of XPath and XSLT and demonstrates how XML and ADO.NET work together, as well as how easy it is to transform one to the other. You also learn how you can serialize your objects to XML and create an object from (or deserialize) an XML document using classes in the System.Xml.Serialization namespace. More to the point, you learn how you can incorporate XML into your C# applications.

You should note that the XML namespace allows you to get similar results in a number of different ways. It is impossible to include all these variations in one chapter, so while exploring one possible way of doing things we’ll try our best to mention alternative routes that will yield the same or similar results.

Because there’s not space here to teach you XML from scratch, we are assuming that you are already somewhat familiar with XML technology. For example, you should be familiar with elements, attributes, and nodes, and you should also know what is meant by a well-formed document. You should also be familiar with SAX and DOM. If you want to find out more about XML, Wrox’s Beginning XML (Wiley Publishing, Inc., ISBN 0-7645-7077-3) is a great place to start.

This chapter covers the following:

  • XML Standards

  • XmlReader and XmlWriter

  • XmlDocument

  • XPathDocument

  • XmlNavigator

The discussion begins with a brief overview of the current status of XML standards.




Professional C# 2005 with .NET 3.0
Professional C# 2005 with .NET 3.0
ISBN: 470124725
EAN: N/A
Year: 2007
Pages: 427

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net