The trouble with XQuery

XQuery was designed by the World Wide Web Consortium as an easier to use alternative to XSLT. In this it succeeded, but most of the power of XSLT was lost.

My critiques of the XQuery specification on this page came just a little late, just a few months after XQuery became a proposed recommendation in november 2006 and there were only a few implementations. But then my critique is of a fundamental nature, rather then just a few changes here and then.

Actually I started this research after reading the first XQuery Working Drafts in 2003. While I had been working with XSLT and could see some things done better in XQuery, it was clear to me that XQuery was not going in the direction I wanted XML manipulation to go. Even though I didn't have the foggiest notion what it was I wanted then.

But let's start with the good things of XQuery:

As is easy to see XQuery is designed as a reaction to XSLT by a group of database guys who were missing some of their favourite tools in XSLT.

I am a database guy as well and I do miss those tools in XSLT as well. However, I still miss a lot of tools in XQuery:

In short I think they threw the baby out with the water.

XQuery does not have the XSLT ability to:

Also it is no longer easy to use the language itself to generate a new source file in the same language.

© MagnaFacta BV 2006-2009