You can see that I am grabbing the latest year, but I'm not sure how to grab the older years given the constraints of XSLT. Any input would be helpful, thanks!
I had actually encountered the same problem with the "Our First Attempt" mentioned in the article, which it did a good job of explaining. If you're working with several nodes, I'd recommend you follow the suggestion of the article and try for the Muench method (similar to what Ernst Utvik posted above - thanks Ernst).
Grouping Articles by Year
Hi all, I'm attempting to write some XSLT that will produce something similar to the following:
2011
2010
Basically, I want the articles in chronological order, but grouped by year.
Here's all I've gotten so far:
You can see that I am grabbing the latest year, but I'm not sure how to grab the older years given the constraints of XSLT. Any input would be helpful, thanks!
Hi Mike
See if you cant get some sense out of this: http://www.jenitennison.com/xslt/grouping/muenchian.html
Another method would be to call a second template to do the year logic based on some passed parameters.
Let us know how you do :)
For whomever stumbles upon this at a future date, I've seemingly had success with the "Grouping with xsl variable" outlined here: http://docstore.mik.ua/orelly/xml/xslt/ch06_02.htm
I had actually encountered the same problem with the "Our First Attempt" mentioned in the article, which it did a good job of explaining. If you're working with several nodes, I'd recommend you follow the suggestion of the article and try for the Muench method (similar to what Ernst Utvik posted above - thanks Ernst).
Anyways, here's my XSLT:
is working on a reply...