Re: [xsl] job for xsl:key? (XSL 1.0 question)

Subject: Re: [xsl] job for xsl:key? (XSL 1.0 question)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 20 Feb 2007 15:57:36 GMT
> No need for key() here, an XPath will be fine:

   val="{sum(//type[@value =
  current()/contact/@type]/@benchmark1)}"/>

actually the OP wants


 val="{sum(for $t in contact/@type return //type[@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

Current Thread