SUMMARY
This chapter began by discussing why XML is becoming more and more prevalent in application and systems development through the use of XML as the data interchange format for documents and via Web Services.
We then briefly overviewed the System.Xml version 1.x classes, detailing the driving design requirements (W3C standards compliance, an XML provider model, and close integration with ADO.NET). We also discussed how these aims have continued with the design of the System.Xml version 2.0 classes. Given that XML is the de facto data interchange format, we then discussed how XML is now the universal data access API, with the world of data and data interchange regarded as XML documents. Classes such as the XmlReader, XmlWriter, and XPathNavigator provide data access APIs for an XML provider model.
We then saw how the landscape for XML is changing as rapidly now as it was five years ago. More XML content is being produced at an increasingly rapid rate. And this rate will only increase because of the advent of Microsoft Office 2003, the evolution of relational DBMSs such as SQL Server to store XML as a native type, and the emergence of the XQuery language as a means to query, aggregate, and manipulate this content.
Next we overviewed the new classes introduced in System.Xml version 2.0, which center on the need for better middle-tier XML programming via XML providers. This topic introduced XML views, which are the translation, using a declarative mapping syntax, of data represented in one data model into an XML data model. XML views provide the benefits of replacing custom procedural mapping code and enabling bidirectional queries and updates to the data store.
We then looked at the XPathDocument2 class that allows updates via the XPathEditor class, which together provide an updatable cursor-style API. The XPathDocument2 also has the ability to track changes to individual nodes, keeping current and original values for inserted, updated, and deleted nodes via the XPathChangeNavigator.
The XmlAdapter, like the ADO.NET DataAdapter, provides the ability to issue queries to SQL Server and return results. It uses XQuery as the query language and XML views to map the SQL Server tables to XML, filling an XPathDocument2 as the disconnected store. When combined with the XPathDocument2 class, the XmlAdapter class provides a parallel set of XML APIs to access data in the middle tier in a manner similar to the relational ADO.NET APIs. The XmlAdapter further integrates deep XML support into ADO.NET.
Finally, we touched on the XQueryProcessor and the XsltProcessor classes introduced into the new System.Xml.Query namespace. These classes provide XQuery and XSLT language support over SQL Server via XML Views and over in-memory XML documents via the XPathDocument2 class.
In the next chapter, we move on to look at the new XPathDocument class in more detail.
|