No need for key() here, an XPath will be fine:
val="{sum(//type[(_at_)value =
current()/contact/@type]/@benchmark1)}"/>
actually the OP wants
val="{sum(for $t in contact/@type return //type[(_at_)value =
$t]/@benchmark1)}"/>
except that's XPath2, for XSLT1 there are several idioms that allow
the sum of a computed value, one suggested by the OP, using a recursive
template, other suggestions
http://www.google.co.uk/search?q=xslt+transform+and+sum
David
--~------------------------------------------------------------------
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>
--~--