<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17599</bug_id>
          
          <creation_ts>2012-06-26 11:51:17 +0000</creation_ts>
          <short_desc>[XQ31ReqUC] Dynamic sort order and collation for order by</short_desc>
          <delta_ts>2014-05-20 16:58:55 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Requirements for Future Versions</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="John Snelson">john.snelson</reporter>
          <assigned_to name="Jim Melton">jim.melton</assigned_to>
          <cc>jim.melton</cc>
    
    <cc>mike</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69399</commentid>
    <comment_count>0</comment_count>
    <who name="John Snelson">john.snelson</who>
    <bug_when>2012-06-26 11:51:17 +0000</bug_when>
    <thetext>It&apos;s often necessary to choose between sort order and collation used at runtime, especially when implementing a GUI - which typically has toggles for options like these. This is particularly hard to do right now, as the &quot;order by&quot; syntax has these as statically determined properties of the expression. One possible way tp do this currently is:

order by
  if($asc) then $i/title else () ascending,
  if($asc) then () else $i/title descending

It would be beneficial to allow an alternate form of &quot;order by&quot; that allows these properties to be specified at runtime.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69402</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-06-26 12:09:20 +0000</bug_when>
    <thetext>Another way of achieving this, which would also have the benefit of adding a sort capability to XPath, would be a higher order sort() function, parameterized by either

(a) a function that computes the sort key, or

(b) a function that compares two items in the sequence to be sorted</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106481</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-05-20 16:58:55 +0000</bug_when>
    <thetext>Assigning to future requirements per Working Group decision (https://lists.w3.org/Archives/Member/w3c-xsl-query/2012Oct/0087.html).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>