[xsl] XSLT grouping without Muenchen Method

Subject: [xsl] XSLT grouping without Muenchen Method
From: "Ismael Cams" <xslt@xxxxxxxxxxx>
Date: Mon, 30 Aug 2004 15:32:56 +0200
Hello all,

I hope somebody can help me with the following problem as I got stuck with it. I have following structure:

<root>
   <object name="object1">
         <instance number="0">
                <sample date_time="2004-08-30 15:06:20"/>
         </instance>
   </object>
   <object name="object2">
         <instance number="0">
                <sample date_time="2004-08-30 15:30:20"/>
         </instance>
   </object>
   <object name="object3">
         <instance number="0">
                <sample date_time="2004-08-30 15:14:20"/>
         </instance>
   </object>
   <object name="object4">
         <instance number="1">
                <sample date_time="2004-08-30 15:06:20"/>
         </instance>
   </object>
    <object name="object5">
         <instance number="1">
                <sample date_time="2004-08-30 15:30:20"/>
         </instance>
   </object>
    <object name="object6">
         <instance number="1">
                <sample date_time="2004-08-30 15:14:20"/>
         </instance>
   </object>
</root>

In the result file I need a grouped structure. As the application for which I have to foresee the stylesheet uses the XT processor of James Clark I can not use the xsl:key function.

The output format I need:

object1,object3;Instance0;2004-08-30 15:00:00
object4,object6;Instance1;2004-08-30 15:00:00
object2;Instance0;2004-08-30 15:30:00
object5;Instance1;2004-08-30 15:30:00

So there is a grouping pro instance and a grouping pro timeinterval. One hour is divided into four time intervals:

00 - 15 -> Interval 1
15 - 30 -> Interval 2
30 - 45 -> Interval 3
45 - 60 -> Interval 4

The grouping pro instance is straight forward, but the grouping with the time intervals has caused me already a lot of headaches.

I hope somebody can provide me with a solution for this problem.

Thanks in advance.

Kind regards,
ismael

Current Thread