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

for-each: Sorting and Grouping

Subject: for-each: Sorting and Grouping
From: "Hyatt, Steve (IndSys, GEFanuc, TCP)" <steve.hyatt@xxxxxxxxxxxxxxxxxx>
Date: Mon, 4 Oct 1999 13:40:43 -0600
steve hyatt
Hiya.

I have an XML file containing a list of interface names (from IDL) with each
having a user-defined class associated with them, which are basic strings.

I have built an XSL file which displays them in a single table, and are
sorted by the "sort-by" attribute in a 'for-each' tag.

The question is, how can I display this list in different tables, groupped
by this class.  What I want to do is something like:

<xsl:for-each select="Interface" order-by="+ Class"> 

<!-- If this is the first time we have seen this class, then output
     a new table which includes a class name.
-->

<!-- Output the current name -->
<tr>
	<td><xsl:value-of select="Name"/></td>
</tr>

<!-- If this is the last interface with this class in the list, end this
     table. -->

</xsl:for-each>


Is this something that can be done?  I was thinking if not, I could add the
class as an attribute to the <Interface> tag, instead of as a sub-tag, and
then doing some sort of conditional selection.  But how do you do this since
you don't know which classes there will be?

Do I need to do this in JavaScript instead?

Any help would be greatly appreciated.

Steve


 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.