Grouping like data
Hi, I'm *very* new to XSLT, and I am having an issue grouping some nested data.
I have Nodes that all have "Shift" data. Within these Shifts, I have a Part Number. Now, and want to be able to group and add together all the data associated with a Part Number, regardless of what Shift it was produced in.
<shift>
<partNo num="1">
<data count="2"/>
<data time="3"/>
</partNo>
</shift>
<shift>
<partNo num="1">
<data count="1"/>
<data time="5"/>
</partNo>
</shift>
<shift>
<partNo num="2">
<data count="5"/>
<data time="7"/>
</partNo>
</shift>
For example, I want to be able to add together all the "counts" for part number 1. Any ideas on how I should get started would be much appreciated!
Thanks!
Andrew
|