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

Sibling sort after grouping

Subject: Sibling sort after grouping
From: "C. Zarate" <lists@xxxxxxxxxx>
Date: Thu, 27 Oct 2005 11:14:28 -0400 (EDT)
sort after
I have a body of content, structured as:

<content>
 <item>
  <tag>...</tag>
  <tag>...</tag>
  <tag>...</tag>
  <date>...</date>
  ...
 </item>
 ...
</content>

My goal is to generate a list of all tags, sortable by date. "Date" in
this context would mean the most recent "date" child of any "item" node
that contains a given "tag" child. Dates are ISO 8601 formatted.

Currently, this list of tags is sorted alphabetically. How can I modify
the below XSL (1.0) to achieve a "last-modified" sort, as outlined above?

<xsl:key name="group-by-tag" select="content/item/tag" use="."/>
...
<xsl:for-each
select="content/node/tag[generate-id()=generate-id(key('group-by-tag',.)[1])]">
 <xsl:sort select="." order="ascending"/>
 <xsl:value-of select="."/>
</xsl:for-each>

Thank you for any assistance you can provide.

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.