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

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