S
shockride
I know this should be easy, but I have been banging my head against it
for too long...
Here is my XML (names changed blah blah)
<Factory>
<Containers>
<Container>
<Country>USA</Country>
<Fruit><Type>Apple</Type><Amount>10</Amount></Fruit>
</Container>
<Container>
<Country>USA</Country>
<Fruit><Type>Banana</Type><Amount>12</Amount></Fruit>
</Container>
<Container>
<Country>USA</Country>
<Fruit><Type>Apple</Type><Amount>13</Amount></Fruit>
</Container>
<Container>
<Country>USA</Country>
<Fruit><Type>Banana</Type><Amount>14</Amount></Fruit>
</Container>
<Container>
<Country>USA</Country>
<Fruit><Type>Peach</Type><Amount>15</Amount></Fruit>
</Container>
</Containers>
</Factory>
Basically I want to walk through this list and sum the different
fruits. I.e, the result from this list would be...
Apple 23
Banana 26
Peach 15
I know that a container contains different types, i.e.
/Factory/Containers/Container/Fruit/Type and that based on this type,
I want to sum the different
/Factory/Containers/Container/Fruit/Amounts, but I'm not sure how to
write the XSL.
Any help would be greatly appreciated.
--Jim
for too long...
Here is my XML (names changed blah blah)
<Factory>
<Containers>
<Container>
<Country>USA</Country>
<Fruit><Type>Apple</Type><Amount>10</Amount></Fruit>
</Container>
<Container>
<Country>USA</Country>
<Fruit><Type>Banana</Type><Amount>12</Amount></Fruit>
</Container>
<Container>
<Country>USA</Country>
<Fruit><Type>Apple</Type><Amount>13</Amount></Fruit>
</Container>
<Container>
<Country>USA</Country>
<Fruit><Type>Banana</Type><Amount>14</Amount></Fruit>
</Container>
<Container>
<Country>USA</Country>
<Fruit><Type>Peach</Type><Amount>15</Amount></Fruit>
</Container>
</Containers>
</Factory>
Basically I want to walk through this list and sum the different
fruits. I.e, the result from this list would be...
Apple 23
Banana 26
Peach 15
I know that a container contains different types, i.e.
/Factory/Containers/Container/Fruit/Type and that based on this type,
I want to sum the different
/Factory/Containers/Container/Fruit/Amounts, but I'm not sure how to
write the XSL.
Any help would be greatly appreciated.
--Jim