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

RE: Grouping by a piece of a date

Subject: RE: Grouping by a piece of a date
From: Michal_Mart@xxxxxxxxxxx
Date: Thu, 7 Sep 2000 14:58:38 -0400
michal mart

Hi Jeff,
I think you will have better luck if you change your select to this

<xsl:for-each

select="/xml/rs:data/z:row[generate-id(.)=generate-id(key('foo',substring-before(@dCreated,'T')))]"

>

Hope this helps,
Michal





Jeff Saylor <JSaylor@xxxxxxxxxxxxxxxxxxxxx> on 09/07/2000 10:13:51 AM

Please respond to xsl-list@xxxxxxxxxxxxxxxx

To:   xsl-list@xxxxxxxxxxxxxxxx
cc:    (bcc: Michal Mart)

Subject:  RE: Grouping by a piece of a date




I had pitched this yesterday in response to Steve's answer, but hadn't
gotten any further input so I thought I might stoke the fire a bit - to
summarize...

>From this XML:

<xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
   xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
   xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">

   <rs:data>
      <z:row iID="1" dCreated="1900-01-01T01:00:00"/>
      <z:row iID="2" dCreated="1900-01-02T01:00:00"/>
      <z:row iID="3" dCreated="1900-01-02T02:00:00"/>
      <z:row iID="4" dCreated="1900-01-04T01:00:00"/>
   </rs:data>
</xml>

I am trying to group the elements based on only the date part of the
dCreated value - resulting in:
   1900-01-01T01:00:00   - iID1
   1900-01-02T01:00:00   - iID2, iID3
   1900-01-04T01:00:00   - iID4


Steve Muench suggested that the following should net me the unique keys that
I could use the Meuncharian method to process through:
   <xsl:key name="foo"
      match="/xml/rs:data/z:row"
      using="substring-before(@dCreated,'T')"/>

Unfortunately, the following outputs no results (using the MSXML3 July
preview rel).:
   <xsl:for-each
      select="/xml/rs:data/z:row[generate-id(.)=generate-id(key('foo',.))]"
>
         <xsl:value-of select="." />
   </xsl:for-each>

Am I missing something/doing something incorrectly, or could someone
confirm/deny that MSXML3 doesn't currently support this?

Much appreciation in advance - Cheers,


Jeffrey J. Saylor
Senior Internet Developer
Diamond Technology, Inc.
707 Mendham Blvd., Suite 104
Orlando, FL 32825
Phone: (407) 262-9000 Ext 266
Fax: (407) 262-9010
Email: jsaylor@xxxxxxxxxxxxxxxxxxxxx


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







 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.