i'm faily clear how to do this as an xslt extension in c# but i am sure this should be simple in xslt only
this is in 4.5.2 so with the new schema
i have some content which relates to an event with a datetimeStart property, and i need to construct a link that links to the next event from the home page, so essentially the events will be ordered by this datetimeStart property anyway so then select the first item that is greater than now
1) it would be better to add something to explicitly order the $futureRaces by the datetimeStart property 2) will $nextRace get only the first result 3) what's the right way to do the date comparison
That should take care of 1) and 2). The right way to do the date comparison is probably via the Exslt.ExsltDates extension. That's where you get the current date from as well (I think it's just :Date() ). Afraid I don't know the exact syntax by heart, however should point you in the right direction.
xslt selection for next item by date
i'm faily clear how to do this as an xslt extension in c# but i am sure this should be simple in xslt only
this is in 4.5.2 so with the new schema
i have some content which relates to an event with a datetimeStart property, and i need to construct a link that links to the next event from the home page, so essentially the events will be ordered by this datetimeStart property anyway so then select the first item that is greater than now
i imagine writing something like the following
what i am not sure about is
1) it would be better to add something to explicitly order the $futureRaces by the datetimeStart property
2) will $nextRace get only the first result
3) what's the right way to do the date comparison
thanks for taking the time to look at this :)
Hi John,
you could put this in a for-each loop, so something like:
That should take care of 1) and 2). The right way to do the date comparison is probably via the Exslt.ExsltDates extension. That's where you get the current date from as well (I think it's just :Date() ). Afraid I don't know the exact syntax by heart, however should point you in the right direction.
Cheers,
Sascha
thanks Sascha - that's very helpful - i'll follow that through
i did like the idea of trying to do it without a loop
if i get it to work i'll post it back here
is working on a reply...