[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Grouping with XSLT

Subject: Grouping with XSLT
From: "Michael Geiling" <mgeiling@xxxxxx>
Date: Wed, 31 Oct 2001 16:07:17 +0100
xsl grouping
I have some XML like
<dates>
<date>
<starth>10</starth>
<endh>12</endh>
<startm>15</startm>
<endm>30</endm>
<activity>Test</activity>
</date>
<date>
<starth>08</starth>
<endh>16</endh>
<startm>12</startm>
<endm>00</endm>
<activity>Test2</activity>
</date>

...
</dates>

and need to generate some sort of table (diary style) where I list the hours from 9-5 in a style like
9:00
9:15
9:30
9:45
10:00
...

Each line needs to get marked if some activity takes place; the lines between start and end need to be marked as well.

My XSL below groups the start times:
<xsl:template match="/">
 <HTML>
  <BODY>
   <xsl:for-each select="//starth[not(. = following::starth)]">
    <H2><xsl:value-of select="."/>:00</H2>
    <xsl:for-each select="//date[starth=current()]">
      <P>Start: <xsl:value-of select="starth"/>:<xsl:value-of select="startm"/>, <xsl:value-of select="activity"/></P>
    </xsl:for-each>
   </xsl:for-each>
  </BODY>
 </HTML>
</xsl:template>

and produces the following html:

<HTML xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <BODY>
       <H2>10:00</H2>
      <P>
 	Start: 10:15, Test
      </P>
      <H2>12:00</H2>
      <P>
        Start: 12:00, Test2
      </P>
   </BODY>
</HTML>

However, I do not get the 11:00 marked although the time is blocked. Could  someone please point me to the right construct ?
Thanks.
______________________________________________________________________________
Keinen Jackpot mehr verpassen! Mit dem Dauerschein des WEB.DE Lottoservice.
Einfach und bequem Lotto tippen! http://tippen2.web.de/?x=4


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.