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

Re: XSL-List Digest V4 #275

Subject: Re: XSL-List Digest V4 #275
From: David Chryst <dchryst@xxxxxxxxx>
Date: Wed, 17 Apr 2002 10:15:25 -0700 (PDT)
 Re: XSL-List Digest V4 #275
Ragulf,
You're close!  Within the <xsl:for-each
select="$unique-dates"> element, introduce an
xsl:sort!
I tested this xslt with MSXML3 and MSXML4.  

<xsl:template name="group-by-date">
  <xsl:variable name="unique-dates"
select="/NewsList/List/News[not(Date=preceding-sibling::News/Date)]/Date"/>
  <xsl:for-each select="$unique-dates">
    <xsl:sort select="substring(.,7,4)"
data-type="number" order="ascending"/>
    <xsl:sort select="substring(.,5,2)"
data-type="number" order="ascending"/>
    <xsl:sort select="substring(.,1,2)"
data-type="number" order="ascending"/>
    Date is: <xsl:value-of select="."/><br/>
    <xsl:for-each
select="/NewsList/List/News[Date=current()]">
      <H1><xsl:value-of select="P1"/></H1>
      <!-- Other such stuff here, but I would like to
put this functionality into another template -->
    </xsl:for-each>
  </xsl:for-each>
</xsl:template>


> I have a problem both sorting and grouping...
> I can sort and I can group (using following two
> templates), but I can't 
> manage to do both and I have been at it for 5 hours
> now, so now I appeal to 
> you for help.
> 
> 
> Problem with the second stylesheet is that while the
> result is grouped by 
> date, it is grouped by how the dates appear in
> document order, which I have 
> no controll over, and I want it by date descending
> like in the first 
> stylesheet.
> 
> If some of you can tell me how to do it, I will be
> very gratefull.
> 
> Sincerly
> Ragulf Pickaxe :)
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

 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.