SUMMARY



SUMMARY

In this chapter, we worked with the XQueryProcessor and XsltProcessor classes—looking first at the interface members and then at how they can be used. We started with a very brief introduction to the XQuery language for the queries used in this chapter. It is really necessary to read the XQuery Language specification at http://www.w3.org/TR/xquery/ to fully appreciate the power of this language.

We saw how the XQueryProcessor class can be used to query over XML documents and over XML views of SQL Server tables. There can be multiple XML views across a single database connection, or multiple XML views across multiple database connections, making XQuery perfect for data aggregation scenarios with data stored in SQL Server tables. We also saw how queries can be combined to retrieve XML through XML views and from XML documents. Because they are built on a Common Query Architecture, both the XQueryProcessor and the XsltProcessor classes can take advantage of query optimization to significantly improve the performance of the executed query, in particular by generating MSIL.

Finally, we covered the xml type that has been introduced in the SQL Server "Yukon" beta 1 release, which allows you to use XML as a native type for columns and variables and within stored procedures. The XML you store can be either untyped or typed. (As mentioned, typed means that it is associated with an XML schema that enforces the XML structure of the stored documents.)

The xml type provides several techniques for querying and updating the values stored in a column, including using the query method with an XQuery statement to return a fragment of untyped XML and using the modify method to execute an XML DML statement. And the introduction of XML as a native type to SQL Server enables it to act like an XML database and hence store documents produced from the Microsoft Office 2003 family. The trilogy of XML content generation from Microsoft Office 2003, the XML storage in SQL Server "Yukon," and the query capabilities available through XML Views technology on the middle tier in the .NET Framework provide an impressive new application-building platform.

With this, we come to the end of the book. Although version 2.0 of the .NET Framework is still young and evolving—it will almost definitely change as it progresses toward a final release—we would like to think that you have found the content of this book useful. It should have helped you understand where Microsoft is taking data access as a whole in version 2.0 and what you have to do to be ready when it arrives.