i have a couple of NewsItems with a date property...
Now i want to make an archive with all the distinct years below each other.. I made my key as below.
And below that i have my foreach which loops thru all my NewsItems...
The problem here is i have 8 or so newsitems, with all different years (as a test).. also i have one with 2012 in the date... But i get all the other years except for the 2012 one... If i change the year (of the date property) to another year say 2014, then i see that year appear in the list. But once put back to any date in 2012, it refuses to show the distinct 2012 year... All other years appear properly...
I dont think i'm doing anything wrong here... right?
In the last code line, i also tried another for-each procedure of the MUENCHIAN method. But the same behaviour as well.
XSL:key strange behavior
Hey guys,
i have a couple of NewsItems with a date property...
Now i want to make an archive with all the distinct years below each other.. I made my key as below.
And below that i have my foreach which loops thru all my NewsItems...
The problem here is i have 8 or so newsitems, with all different years (as a test).. also i have one with 2012 in the date... But i get all the other years except for the 2012 one... If i change the year (of the date property) to another year say 2014, then i see that year appear in the list. But once put back to any date in 2012, it refuses to show the distinct 2012 year... All other years appear properly...
I dont think i'm doing anything wrong here... right?
In the last code line, i also tried another for-each procedure of the MUENCHIAN method. But the same behaviour as well.
Hi Vishal,
You're right, the code looks like it should work... you could try the following snippet, just as a sanity-check:
/Chriztian
Hi Chriztian,
i tried that code as well yesterday, but still got the same result.. I converted to C# extension method to get the distinct years and that worked :-)
So for now this still remains a puzzle... anywho... thanks for your input..
is working on a reply...