xsl-list
[Top] [All Lists]

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

2007-02-20 08:57:56

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