Hi Berthold,
Maybe this is what’s happening:
The for loop iterates through each track, and assigns the value to a variable ($t). Therefore the variable will contain only one track at a time, and therefore, its position will always be 1.
Perhaps a workaround could be:
LET $numTracks = count($a/track)
FOR $t IN (1 TO $numTracks)
LET $track = $a/track[$t]
RETURN
{ concat(string($t),“-”,string($track/title)) }
{ concat(substring-before(substring-after(string($track/duration),“M”),“S”),“:”,substring-after(string($track/duration),“S”)) }
}
Best Regards,
Puny Sen
#Tamino#webMethods#API-Management