Desidirius
Programmer
So I'm setting up a stats XML, and I'd like to track each player's game-by-game stats and then provide a sum of their statistics. The XML file looks something like this in my head:
<roster>
<player1>
<game1>
<stat1>
</stat1>
<stat2>
</stat2>
</game1>
<game2>
<stat1>
</stat1>
<stat2>
</stat2>
</game2>
</player1>
<player2>
<game1>
<stat1>
</stat1>
<stat2>
</stat2>
</game1>
<game2>
<stat1>
</stat1>
<stat2>
</stat2>
</game2>
</player2>
</roster>
How would I structure a function to sum up stat1 player-by-player, rather than for the entire roster?
<roster>
<player1>
<game1>
<stat1>
</stat1>
<stat2>
</stat2>
</game1>
<game2>
<stat1>
</stat1>
<stat2>
</stat2>
</game2>
</player1>
<player2>
<game1>
<stat1>
</stat1>
<stat2>
</stat2>
</game1>
<game2>
<stat1>
</stat1>
<stat2>
</stat2>
</game2>
</player2>
</roster>
How would I structure a function to sum up stat1 player-by-player, rather than for the entire roster?