[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: job for xsl:key? (XSL 1.0 question)
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|