xsl-list
[Top] [All Lists]

Re: [xsl] What do these expressions mean ?

2008-03-22 05:03:05
Z W wrote:

What do each of these mean ?


<xsl:apply-templates select="sampleResult[generate-id() =
generate-id(key('group', @label)[1])]"/>


<xsl:template match="sampleResult">
      <xsl:value-of select="@label"/>
      <xsl:for-each select="key('group', @label)">

      </xsl:for-each>
<xsl:template/>

That is Muenchian grouping, used with XSLT 1.0, read more on that here: <URL:http://www.jenitennison.com/xslt/grouping/index.xml>

But note that you don't need that approach if you use XSLT 2.0, there you can use
  <xsl:for-each-group select="sampleResult" group-by="@label">
    <xsl:value-of select="current-grouping-key()"/>
    <xsl:for-each select="current-group()">
which is hopefully clearer.

--

        Martin Honnen
        http://JavaScript.FAQTs.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>