RE: New "order by" clause

Jonathan wrote:

Many people felt that two different ways to do sorting was too much 
in a 1.0 release.

But the "where" clause on FLWR (FLWOR?) statements duplicates the
function of the "if" expression, just as "order by" duplicates the sort
functionality.

I don't see it stated explicitly, but I suspect that the motivation for
going to "order by" is to allow easy mapping of XQuery expressions onto
an underlying relational database.  Would you say that this is the case?
And is that a good rationale for designing a language feature?

I found "sortby" (or "sort by") to be intuitively pretty simple, and
more general than "order by".  The latter complicates simple queries; I
can't say

	document("mystuff.xml")//name sortby(.)

to get an alphabetical list of names any more, for example.  Also, if I
want to sort a sequence of constructed XML documents, I now need to use
a for loop (rather than sorting the output of the for loop that creates
the sequence); this seems excessive complicated.  And all of this is to
facilitate early implementations?   The XQuery 1.0 Introduction states
that it is designed to allow queries that are "concise and easily
understood".  I would argue that "sort by" is both more concise and more
easily understood than using a loop with an "order by" for the same
purpose.  (And I notice that you dropped "easy to implement" a few
revisions back. :-)

I would appreciate hearing more rationale for making such a major change
at such a late date in the process.  Thanks...

Jim Davies
Senior Engineer
NeoCore Inc.
jdavies@neocore.com

Received on Tuesday, 19 November 2002 13:22:23 UTC