Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I have an rss feed of the format:
- <rss>
- <tvshow id="17279" day="1" start="600" end="720" duration="120">
- <description> show 1 is about.. </description>
- </tvshow>
- <tvshow id="17280" day="1" start="800" end="920" duration="120">
- <description> show 1 is about.. </description>
- </tvshow>
- <tvshow id="17283" day="1" start="1000" end="1120" duration="120">
- <description> show 1 is about.. </description>
- </tvshow>
- <tvshow id="17289" day="1" start="1500" end="1620" duration="120">
- <description> show 1 is about.. </description>
- </tvshow>
- <tvshow id="17281" day="2" start="600" end="720" duration="120">
- <description> show 1 is about.. </description>
- </tvshow>
- <tvshow id="17282" day="3" start="600" end="720" duration="120">
- <description> show 1 is about.. </description>
- </tvshow>
- </rss>
- I am aiming to have my XSL to get the current Time (ie xslt2 currentTime). I want to compare this time to see if it falls within the interval of each of the show on a specific day (ie day 1). If it falls within that timeslot, then I want to grab the description tag. However, if the currentTime is within 30 minutes of the next show, I want the description to update within that 30 minute interval.
- I can't think out the proper way to do this in XSL. I can store a currentTime and then take the difference of the currentTime and the start time, and then compare the minimums. This is easy to say but how do I code this in xsl?
- Can I do something a recursive look to find the minimum difference (ie current show?)
- example:
- <xsl:if test="min(currentTime-/rss/tvshow/@start)"/>
- <xsl:value-of select="description"/>
- </xsl:if>
- I take it that XSL is a little unintuitive since its done via recursion, but how would i implement something like this? just doing a test on min -- does it go through all the elements and finds the minimum?
Add Comment
Please, Sign In to add comment