<?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>1308</bug_id>
          
          <creation_ts>2005-05-06 14:09:34 +0000</creation_ts>
          <short_desc>proposal: merge xsl:perform-sort and xsl:sequence</short_desc>
          <delta_ts>2005-07-27 22:47:23 +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>XSLT 2.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 2000</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</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="David Carlisle">davidc</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <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>3541</commentid>
    <comment_count>0</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2005-05-06 14:09:35 +0000</bug_when>
    <thetext>As far as I can tell, an xsl:perform-sort is identical in all respects to
xsl:sequence except that in perform-sort (at least one) xsl:sort is mandatory
and in xsl:sequence xsl:sort is not allowed.

I would propose to remove xsl:perform-sort from the specification and allow
xsl:sort as a child of xsl:sequence (so that the semantics of xsl:sequence
become those currently used for xsl:perform-sort if it has an xsl:sort child)


This simplifies the specification (one less element) and makes the use of
xsl:sort more consistent. In other cases xsl:sort is optionally allowed as a
child of the containing instruction (eg xsl:for-each) with sorting occurring if
it is present, it is only in this case that there are two separate instructions,
one requiring a sort specification and the other not allowing it.

David</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3542</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-05-06 15:27:36 +0000</bug_when>
    <thetext>Thanks for the suggestion, the WG will look at it.

It&apos;s a cosmetic change, but personally I&apos;m reasonably sympathetic to it.
xsl:perform-sort is proving to be one of the less-frequently-used features of
2.0, and perhaps if it&apos;s combined with xsl:sequence more people will notice its
existence.

Michael Kay (personal response)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3331</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-05-13 18:19:15 +0000</bug_when>
    <thetext>We discussed this on 12 May without coming to a firm conclusion: the outstanding
technical question was what we should do about an xsl:perform-sort instruction
containing a sequence constructor (which is allowed by xsl:perform-sort but not
by xsl:sequence). 

I suggested during the telcon that

&lt;xsl:perform-sort&gt;
  &lt;xsl:sort select=&quot;...&quot;/&gt;
  &lt;instructions&gt;...
&lt;/xsl:perform-sort&gt;

is equivalent to

&lt;xsl:for-each select=&quot;.&quot;&gt;
  &lt;xsl:sort select=&quot;...&quot;/&gt;
  &lt;instructions&gt;...
&lt;/xsl:perform-sort&gt;

but I was wrong: the second case computes sort keys from the input sequence (.),
not from the output sequence.

I think my instinct now is to leave it alone. It ain&apos;t broke, and fixing things
that ain&apos;t broke during the end game always risks introducing bugs.

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3246</commentid>
    <comment_count>3</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2005-05-14 23:37:30 +0000</bug_when>
    <thetext>&gt; It ain&apos;t broke, and fixing things
&gt; that ain&apos;t broke during the end game always risks introducing bugs.

As a general rule there is a lot to be said for that, and if that ends up
being the offical WG posssition, I won&apos;t object here (I may grumble a bit on
xsl-list but that&apos;s a different thing...)

However while it isn&apos;t broke, the current spec just feels wrong to me.
I expected to be able to use xsl:sort with xsl:sequence and was surprised when I
couldn&apos;t and surprised to find xsl:perform sort which had somehow escaped my
attention before. However I know it&apos;s getting late for such comments.


My &quot;safe&quot; plan would be
a)
allow xsl:perform-sort to have no xsl:sort children with the effect being that
it returns the specified sequence in the input order.
b)
remove the existing xsl:sequence
c)
rename xsl:perform-sort to xsl:sequence
d)
fix up references to perform-sort and error codes to take account of the change.


If that plan is workable then it looks fairly safe to me. (But I have not done a
full analysis of the spec changes and code changes to implementation that would
result)

If there are hidden (or not so hidden) problems that mean that doing this merge
means that you need to do more careful surgery and design of new instruction
semantics, then reluctantly I&apos;d agree that it might be getting late for new
features.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5256</commentid>
    <comment_count>4</comment_count>
    <who name="Sharon Adler">sca.w3c</who>
    <bug_when>2005-07-27 22:16:10 +0000</bug_when>
    <thetext>David, thanks again for your comment and suggestions.  The WG considered this 
very carefully and although there was sympathy for it we concluded that we did 
not want to make an non-essential change at this point in the process.  Please 
let us know if you are not willing to accept this conclusion.  If we do not 
hear from you in one week we will deem this comment closed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5257</commentid>
    <comment_count>5</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2005-07-27 22:47:23 +0000</bug_when>
    <thetext>As I indicated earlier, I half expected this outcome.
I&apos;m closing the report with no formal objection, but I may object
over a beer if I catch any of the WG in a pub...</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>