xsl-list
[Top] [All Lists]

Re: [xsl] Getting average

2008-05-27 14:19:03
<xsl:variable name="contemporaries" select="//person[(_at_)age=$age]"/>

Sum their incomes:

sum($contemporaries/group/@income)

That should probably be sum($contemporaries/parent::group/@income)


<cutomers>
       <group income=1000>
               <person age=10/>
               <person age=15/>
               <person age=30/>
       </group>

       <group income=2000>
               <person age=10/>
               <person age=40/>
       </group>

       <group income=5000>
               <person age=20/>
               <person age=20/>
       </group>
</customers>




-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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