0

I have a problem. I have an XML tree which looks similar to this:

<wd:meta>
    <wd:creation time="[TIMESTAMP]" />
    <wd:title><![CDATA[Nice title]]></wd:title>
</wd:meta>

And there are many more siblings with the same Structure. This tree goes into the XSLTProcessor and gets a nice Stylesheet. Now i want to take this apart into months (In my Stylesheet). So that there is something like that:

Everything that happed in August

Nice title 1

Nice title 2

Everything that happend in September

Nice title 3

Nice title 4

How can i do something like this? I made a little bit of research but i wasn't very successful. The only thing i found what would be maybe useful was that: following-sibling

Can anyone help me? I really appreciate your help.

Thanks.


edit://

I now used the Muenchian method adopted from http://www.jenitennison.com/xslt/grouping/muenchian.html but i only can order it by month, NOT by year. I tried the Answer of the possible duplicate and tried to understand it, but it's not that easy. Has anyone a easier solution?

planIT
  • 241
  • 1
  • 2
  • 8
  • Possible duplicate of [XSLT, sort and group by year-date](http://stackoverflow.com/questions/1770383/xslt-sort-and-group-by-year-date) – Filburt Aug 29 '11 at 14:17
  • Thanks. Yes i think it's the same problem. My research was not this good -.- But the answer there is too high for me anyway. I am a real beginner. – planIT Aug 29 '11 at 14:37

1 Answers1

0

In a first step i would iterate your content and generate a monthname for your timestamps. Then you can sort it by the month name. If you have xslt 2.0 you can use group-by to group them by month. If not, you can acturlly iterate your content and check if there is a following-sibling with the current month name. If so, go on with the same month name as the month of the current element. If not, start a new month.

Chris
  • 7,675
  • 8
  • 51
  • 101
  • thank you, i will try to add a new attribute where i will save the month. And i look if i can do this with your advice. – planIT Aug 29 '11 at 14:34