XQuery 1.0 and XPath 2.0 are now W3C Recommendations, thanks in part to the contributions of several Microsoft employees over the years. An earlier draft of the XQuery specification is supported in SQL Server 2005 , and you can send an XQuery to the server using the ADO.NET that shipped in Visual Studio 2005. These features are becoming widely used. Now that the XQuery family of specifications is complete, it’s fair to ask what our implementation plans might be,
We had been working on an implementation of XQuery in the .NET Framework that operated over standalone XmlDocuments several years ago, and showed the work in progress in the first beta of what became Visual Studio 2005. That was not shipped for several reasons . The most compelling reason was that it was obvious in 2004 that the W3C Recommendation would not be complete before that product release was frozen. Another reason was that this seemed like it was just XSLT in a different skin, whereas what our customers really wanted was a more powerful implementation that provided advanced features such as in-memory indexes and support for mapping parts of the query to the back-end server, including use of the XML datatype and XQuery provided by SQL server. This would have been much more work, and would have required us to go far beyond what the W3C was standardizing – so our focus back then was to make sure the back end server support for XQuery was rock solid. We have had occasional requests from our user community for a client side implementation of XQuery that operates over standalone XmlDocuments, but we see no clear groundswell of demand yet.
We very much wish to hear from our user community about their requirements that could be met with XSLT 2.0 and XQuery 1.0. We announced last week that we are actively working on an XSLT 2.0 implementation. As with XLST 2.0, those needing an implementation of XQuery that runs in the .NET environment may wish to check out the Saxon open source project http://saxon.sf.net or the schema-aware commercial version produced by Saxonica http://www.saxonica.com/products.html. Likewise, those needing query and transformation features over standalone XML files could help us understand whether XSLT 2.0 meets your needs, or if you think XQuery is more suitable.
We are very excited about the Language Integrated Query (LINQ) work that is our primary focus for “Orcas”. In LINQ you will see “LINQ to XML” and VB-XML language extensions that provide functionality similar to XQuery, but with LINQ you can operate over Objects, SQL Databases and XML documents … and can create your own LINQ provider to support virtually any other type of data. We are also incubating LINQ to XSD for XSD-based generation of strongly typed object models that support the LINQ programming model.
We do recognize, however, that some scenarios require a cross-platform standards based approach and so while we finish up “Orcas” we will be listening to our customers to figure out how to blend of these technologies and create a roadmap for our future products. Some have asked for an XQuery-powered in-memory database with indexes, query plans, an optimizer, etc. Some have asked for something that might be called “LINQ to XQuery” that would provide a LINQ-enabled front end for an XQuery-enabled DBMS, much like what LINQ to SQL provides for an RDBMS. You might have even more interesting ideas for how to combine our technology innovations and the W3C standards to provide high Windows productivity/performance and cross-platform interoperability. We can’t do all of this, but we can focus on the approach that meets the most real-world needs with the time and resources available. Now is a great time to have an influence on those plans, so please don’t hesitate to send your feedback to the XML Team contact page.