First find the distinct values for SYMBOL, using a grouping method (such as
the Muenchian method,
see:
http://www.jenitennison.com/xslt/grouping/)
Then iterate over these distinct values and produce the following value:
sum($yourDocument//ROW[SYMBOL = current()]/AMOUNT)
Of course, you may be using keys, in which case you'll be evaluating
something like this:
sum(key('kSymByVal', $aDistinctValue)/../AMOUNT)
Cheers,
Dimitre Novatchev
"Rivky" <> wrote in message
news: ups.com...
> Hi. I have XML that is something like this?
>
> <ROW>
> <SYMBOL>A</SYMBOL>
> <AMOUNT>10</AMOUNT>
> </ROW>
> <ROW>
> <SYMBOL>A</SYMBOL>
> <AMOUNT>20</AMOUNT>
> </ROW>
> <ROW>
> <SYMBOL>B</SYMBOL>
> <AMOUNT>10</AMOUNT>
> </ROW>
> <ROW>
> <SYMBOL>C</SYMBOL>
> <AMOUNT>50</AMOUNT>
>
> </ROW>
> <ROW>
> <SYMBOL>C</SYMBOL>
> <AMOUNT>60</AMOUNT>
> </ROW>
>
> I would like to get the SUM of AMOUNT based on the Symbol. Is there any
> way to do this dynamically, using XSL/XSLT without having to specify
> SYMBOL = 'A'. Rather something like For each Symbol, sum the Amounts.
>
> Thanks in advance!
>