I apologize in advance for this one, it's a little complicated and I don't know all the proper terms... I am still learning XSL. I ran into an problem that I can't figure out:
How do I sum data across multiple areas based on a unique attribute?
The data set I have is pretty large, so I'm going to try to paraphrase it with some psuedocode for clarity:
<InRoads ....>
<GeometryProject....>
<HorizontalAlignment name="40000" TaxID="123" area="100" Type="FEE" ExArea="2000">
...
</HorizontalAlignment>
<HorizontalAlignment name="40001" TaxID="123" area="100" Type="TCE" ExArea="2000">
...
</HorizontalAlignment>
<HorizontalAlignment name="40002" TaxID="123" area="100" Type="PE" ExArea="2000">
...
</HorizontalAlignment>
<HorizontalAlignment name="40003" TaxID="456" area="100" Type="FEE" ExArea="5000">
...
</HorizontalAlignment>
<HorizontalAlignment name="40004" TaxID="456" area="100" Type="FEE" ExArea="5000">
...
</HorizontalAlignment>
<HorizontalAlignment name="40005" TaxID="456" area="100" Type="TCE" ExArea="5000">
...
</HorizontalAlignment>
<HorizontalAlignment name="40006" TaxID="789" area="100" Type="FEE" ExArea="8000">
...
</HorizontalAlignment>
<HorizontalAlignment name="40007" TaxID="789" area="100" Type="FEE" ExArea="8000">
...
</HorizontalAlignment>
<HorizontalAlignment name="40008" TaxID="789" area="100" Type="PE" ExArea="8000">
...
</HorizontalAlignment>
</GeometryProject>
</InRoads>
I want to sum up the @area for each @TaxID, as long as the @Type is FEE, and then subtract from @ExArea.
So, TaxID=789 for example:
8000 - (100 + 100) = 7800
So from the above psuedocode, the expected output would be
TaxID 123 remaining area = 1900
TaxID 456 remaining area = 4800
TaxID 789 remaining area = 7800
I was able to figure out how to subtract @area from @ExArea if Type='FEE', but I cannot figure out how to sum based on the TaxID.
Any help would be greatly appreciated.