[Home] [By Thread] [By Date] [Recent Entries]
On 2/20/07, Steve <stephen@xxxxxxxxx> wrote:
I could do the following easily by making a recursive template and then looping through the contacts, and passing on the corresponding benchmark value. But could xsl:key make for a shorter, more elegant solution? No need for key() here, an XPath will be fine: <xsl:template match="contact">
<totals>
<benchmark val="{sum(//type[@value =
current()/contact/@type]/@benchmark1)}"/>
....You'll need to adjust the path to <type> according to your XML. cheers andrew
|

Cart



