xsl-list
[Top] [All Lists]

Re: summing, ok

2005-02-13 03:09:12
Tempore 10:41:24, die 02/13/2005 AD, hinc in xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com scripsit Mukul Gandhi <mukul_gandhi(_at_)yahoo(_dot_)com>:

<xsl:template match="/cars">
  <xsl:variable name="modelcount">
    <xsl:for-each select="car[generate-id(.) =
generate-id(key('by-model',model)[1])]">
      1
    </xsl:for-each>
  </xsl:variable>

  Total no of models - <xsl:value-of
select="string-length($modelcount) -
string-length(translate($modelcount,'1',''))" />

</xsl:template>

or

<xsl:template match="/cars">
        Total no of models -
<xsl:value-of select="count(car[generate-id(.) = generate-id(key('by-model',model)[1])])" />
</xsl:template>

--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
Laudeo W3C et dona ferens

--~------------------------------------------------------------------
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>