xsl-list
[Top] [All Lists]

RE: xsl:perform-sort (in 2.0)

2005-04-05 03:35:58
I just noticed this new instruction (although it was in the last draft
as well)

Is there any difference bewteen

  <xsl:perform-sort select="$in">
    <xsl:sort select="."/>
  </xsl:perform-sort>

and

  <xsl:for-each select="$in">
    <xsl:sort select="."/>
    <xsl:copy-of select="."/>
  </xsl:for-each>

either from a definitional or efficiency point of view?


It's actually been there quite a while, and I think it's proving to be
perhaps the least-used new feature in the spec. It was put in as a
replacement for a sort() function which took a global sort specification as
an argument - rather like xsl:key and key() - but it doesn't seem to be
doing a very useful job.

Actually the equivalence is to:

   <xsl:for-each select="$in">
     <xsl:sort select="."/>
     <xsl:sequence select="."/>
   </xsl:for-each>

since no copying is involved.

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>