[sc34wg3] TMQL: Scope and tuple sequences

Robert Barta rho at devc.at
Fri Nov 9 12:59:15 EST 2007

On Fri, Nov 09, 2007 at 10:41:43AM -0500, Patrick Durusau wrote:
> >would tend more to have the query author be fully in charge, i.e. the
> >language should allow/force to be VERY EXPLICIT _what_ should happen:
> >
> >  
> I assume the same answer to the earlier question about sorting?
> That is that sorting must be explicitly defined for any query result?


By default, no ordering of results (be they tuples, XML fragments, ...)
is done. The query

   select $p / shoesize
      $p isa person

returns something like


If this unordered sequence is to be sorted according to a particular
criterion, then one has to say so:
   select $p / shoesize
      $p isa person
   order by $p / shoesize

There is a lot of subtleness in ordering, though. For details please
refer to


The "unordered and ordered sequence" stuff we got from XQuery/XPath 2.0.
I think these guy have done it right.


More information about the sc34wg3 mailing list