I am new to the whole XSLT thing and I've already tried looking it up through several forums, but I still haven't found the actual solution to my problem.
I have the following XML:
<Cinema>
<Movie name="movie1" in="191" out="191">
<Period time="16:00:00" in="20" out="20"/>
<Period time="18:00:00" in="71" out="70"/>
<Period time="20:00:00" in="100" out="101"/>
</Movie>
<Movie name="movie2" in="105" out="105">
<Period time="16:00:00" in="13" out="13"/>
<Period time="18:00:00" in="34" out="34"/>
<Period time="20:00:00" in="58" out="58"/>
</Movie>
<Movie name="movie3" in="247" out="247">
<Period time="16:00:00" in="57" out="57"/>
<Period time="18:00:00" in="75" out="72"/>
<Period time="20:00:00" in="115" out="118"/>
</Movie>
</Cinema>
What I am trying to get is the total visitors of each movie period. For example:
16:00h - in: 90, out: 90
18:00h - in: 180, out: 176
20:00h - in: 273, out: 277
Total - in: 543, out: 543
I tried nested for each loops but I couldn't really figure out how to use it in this kind of example, because XSLT doesn't accept changeable variables, which I am actually used to (procedural programming).
Does anyone have a simple solution to this problem for me? Thanks in advance!