xsl-list
[Top] [All Lists]

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

2007-02-20 11:10:35
Can someone provide me a solution that doesn't involve the left bracket? =)

Thanks for picking up the challenge guys, I have plenty to work with,

-Steve

On 2/20/07, Steve <stephen(_at_)yeago(_dot_)net> 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?

Instead of performing an addition for each <contact>, could I simply
sum() them at once, somehow?

With the following XML

<types>
    <type value="1" benchmark1="540" />
    <type value="2" benchmark1="640" />
    <type value="3" benchmark1="740" />
</types>
<contacts>
    <contact type="1" />
    <contact type="2" />
    <contact type="3" />
    <contact type="3" />
</contacts>

desired output:

<totals>
    <benchmark val='2660'  />
</totals>


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