XSL sort

Hi
I haven't looked in any great detail at the new spec so my apologies of these comments are irrelevant:

Consider the following snippet from an xsl file taken from the w3c schools tutorial:


<xsl:for-each select="catalog/cd">
      <xsl:sort select="artist"/>
      <tr>
        <td><xsl:value-of select="title"/></td>
        <td><xsl:value-of select="artist"/></td>
      </tr>
</xsl:for-each>




Apart from the nested sort, the xsl nexted within the 'for each' block acts on each specific  'cd' element found in the xml file to be transformed.
In my view, it is unintuitive and confusing to have the 'sort'  instruction at this level when it really pertains to the whole iteration. I think a syntax
like this makes more intuitive sense.


<xsl:for-each select="catalog/cd"   sort="artist">
        <tr>
        <td><xsl:value-of select="title"/></td>
        <td><xsl:value-of select="artist"/></td>
      </tr>
</xsl:for-each>


Regards
Kevin O'Riordan

Received on Wednesday, 9 January 2002 08:29:37 UTC