xsl-list
[Top] [All Lists]

Re: [xsl] Grouping upon various attribute values

2006-08-16 15:53:18
David Carlisle wrote:

<xsl:function name="f:key">
  <xsl:param name="nodes" as="item()*"/>
  <xsl:value-of separator="|">
  <xsl:perform-sort select="$nodes">
  <xsl:sort select="name()"/>
  </xsl:perform-sort>
  </xsl:value-of>
</xsl:function>

  That requires that name() will always return the same string for two
nodes with the same name (same namespace URI and same local part name),
which is not guaranted.  IMHO you need, as Mike proposed it, the two
keys:

    <xsl:perform-sort select="$nodes">
      <xsl:sort select="namespace-uri()"/>
      <xsl:sort select="local-name()"/>
    </xsl:perform-sort>

  Regards,

--drkm






















        
 p4.vert.ukl.yahoo.com uncompressed/chunked Wed Aug 16 22:13:41 GMT 2006 
        
                
___________________________________________________________________________ 
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet 
! 
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos 
expériences. 
http://fr.answers.yahoo.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>
--~--