[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Count all the elements of a column


Subject: Re: [xsl] Count all the elements of a column
From: "Ritu" <rkama@xxxxxxxxxxx>
Date: Thu, 14 Nov 2002 14:11:37 -0600

Hi,

codenet is not an attribute, it is child element of agent. You can compute
the sum as
<xsl:value-of select="sum(agent/codenet)"/>

This should give you the value 17.


Ritu Kama
Work: (630) 734-5947
email: rkama@xxxxxxxxxxx


----- Original Message -----
From: "Yann Verlynde" <yverlynde@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, November 14, 2002 11:55 AM
Subject: Re: [xsl] Count all the elements of a column


> sorry I use this xml file structure:
> <agent id="058">
>
> <datenaissance>27/02/1977</datenaissance>
>
> <sexe>F</sexe>
>
> <cadreemploi>emploi8</cadreemploi>
>
> <codenet>8</codenet>
>
> <specialite>specialite8</specialite>
>
> <discipline>discipline8</discipline>
>
> <datedebut>8/01/1977</datedebut>
>
> </agent>
>
> <agent id="059">
>
> <datenaissance>27/02/1977</datenaissance>
>
> <sexe>M</sexe>
>
> <cadreemploi>emploi9</cadreemploi>
>
> <codenet>9</codenet>
>
> <specialite>specialite9</specialite>
>
> <discipline>discipline9</discipline>
>
> <datedebut>9/01/1977</datedebut>
>
> </agent>
>
>
>
> My table is constructed by a for-each tag and I want to sum all codenet
> Attribute
>
>
>
> Thanks
>
>
> ----- Original Message -----
> From: "Yann Verlynde" <yverlynde@xxxxxxxxx>
> To: <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
> Sent: Thursday, November 14, 2002 6:37 PM
> Subject: [xsl] Count all the elements of a column
>
>
> > Hello,
> >
> > How can i do to count all the elements of a column in a table?
> >
> > My table is build by a for-each tag.
> >
> > Thanks in advance
> >
> > <xsl:variable name="agent-sexe-F" select="agent/sexe[ text() = 'F' ]"/>
> >
> > <xsl:variable name="somme-agent-sexe-M"
> > select="sum($agent-sexe-M/codenet)"/>
> >
> >
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
xml