[xsl] subtracting sums from different groups

Subject: [xsl] subtracting sums from different groups
From: dmitrik@xxxxxxxxxxxxxx
Date: Sun, 9 Jan 2005 17:56:16 -0500 (EST)
for each was used to create sums for this initial xml


<port>
<version>1</version>
<trade>
 ....
</trade>
<trade>
 ...
</trade>
<trade>
....
</trade>
</port>

the XML has now changed to have two ports (for now)

<toplevel>
<port>
<version>1</version>
<trade>
  ...
</trade>
<trade>
...
</trade>
<trade>
...
</trade>
</port>
<port>
<version>2</version>
<trade>
....
</trade>
<trade>
....
</trade>
<trade>
...
</trade>
</port>

</toplevel>


An intial idea was to check  to see if the sums were being created for version 1 or version 2, but this 
does not seem to work. the structure of port version 1 and version 2 are the same, except the summed values
will be different. The goal is to subtract version 1 from version 2 for each value which is summed. What grouping
structure needs to be used? Previously there was one for each which correctly summed all trades under port.
Now that there are two port tags , and the values of the port contents need to be subtracted from each other, any idea what needs to be changed?

Thanks,
dmitri

Current Thread