Hi!
Thank you for your answer. I learned a lot of what you wrote, but it didn't completely solve my problem. I don't think I described it good enough!!
Problem 1)
The function sum(preceding-sibling::StopLink/@runtime) calculates (as I understand) the total runtime for ALL the <Stoplink>s listed before the current <StopLink>. The problem is that sometimes just some of the <StopLink>s listed before are included.
For example in one journey, the <StopLink>s with the stoplinkid's 1,2,4,5,7 are part of the journey. Using the sum(preceding-sibling::StopLink/@runtime) gave me the right answer for the first two calculations ,but wrong answer for the last three since the <StopLink>s with id = 3 and 6 are excluded and not part of the journey.
Problem 2)
Here I have almost solved the problem using the function you gave me. When I added the departuretime for one journey and added the runtime to the first stop (05:30:00 + 35) I got a total of 19800 seconds. The problem appeared when I wanted to recalculate 19800 to the form hh:mm:ss. I got 5:30:0 (5 hours,30 minutes an 0 seconds), but I want it to be 05:30:00. I want it to be exactly two digits before and after both the semicolons. The problem is to deside (in the code at runtime)when to add an extra 0 in time-expression (hh:mm:ss) and how to do it.
1)If the result is 17:34:12 no 0 is to be added.
2)If the result is 13:4:3 two 0 is to be added. One for the minutes (should be 04) and one for the seconds (03).
I have twisted my head today, but I didn't find any good solutions. Sorry if I bother you, but I really want this to be right