Hello,
First, thanks for your time for having a look at my question.
I am trying to come up with a code that loops through a template,
finds an element called start_time and call the value of the element and subtract an hour for the time change due to daylight savings. And there are multiple start times and that's why I am going to have to use a loop.
This is the original xml.
There are other elements existing inside PlaylistItem, but I have removed them for
simplicity. The desired output is, for example,
2015-10-12T11:07:39.924
to be
2015-10-12T12:07:39.924
shifted back by an hour for every one of them inside PlaylistItem inside Block.
Your help will be very much appreciated.
<Block>
<PlaylistItem>
<StartTime>2015-10-12T11:59:42.201</StartTime>
</PlaylistItem>
<PlaylistItem>
<StartTime>2015-10-12T11:07:39.924</StartTime>
</PlaylistItem>
<PlaylistItem>
<StartTime>2015-10-12T20:29:42.211</StartTime>
</PlaylistItem>
<PlaylistItem>
<StartTime>2015-10-12T09:39:58.901</StartTime>
</PlaylistItem>
<PlaylistItem>
<StartTime>2015-10-12T12:04:50.551</StartTime>
</PlaylistItem>
</Block>
I am very new to this XSLT world and I only have a basic piece of logic for this problem. So my logic here is to
1)iterate through the Block
2)access PlaylistItem, access StartTime
3)grab this string
4)use substring and grab the hour characters in the string
5)subtract one from it and then save it
6)make sure this applies to every startTime inside every Playlist in Block.
I'm trying to search for the proper syntax for this and then implement it but
right at the moment I don't have any valid executable code that I can post here.
Please help! And I'll be updating this post as I try to write the code myself.
Thanks again.