W3C home > Mailing lists > Public > public-qt-comments@w3.org > September 2015

[Bug 29160] New: [XQ31] Obsolete Note under "order by"

From: <bugzilla@jessica.w3.org>
Date: Tue, 29 Sep 2015 17:39:09 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-29160-523@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=29160

            Bug ID: 29160
           Summary: [XQ31] Obsolete Note under "order by"
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery 3.1
          Assignee: jonathan.robie@gmail.com
          Reporter: mike@saxonica.com
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

Section 3.11.8 ends with the obsolete Note:

Note:

Since the order by clause in a FLWOR expression is the only facility provided
by XQuery for specifying a value ordering, a FLWOR expression must be used in
some queries where iteration would not otherwise be necessary. For example, a
list of books with price less than 100 might be obtained by a simple path
expression such as $books/book[price < 100]. But if these books are to be
returned in alphabetic order by title, the query must be expressed as follows:

for $b in $books/book[price < 100]
order by $b/title
return $b

This could be replaced by a new Note:

An alternative way of sorting is available from XQuery 3.1 using the fn:sort
function. In previous versions of the language, a set of books might be sorted
into alphabetic order by title using the FLWOR expression:

for $b in $books/book[price < 100]
order by $b/title
return $b

In XQuery 3.1 the same effect could be achieved using the expression

$books/book
=> filter(function($book){$book/price < 100}) 
=> sort(function($book){$book/title})

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Tuesday, 29 September 2015 17:39:13 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 29 September 2015 17:39:13 UTC