RE: [xsl] Can you group in XSL?

Subject: RE: [xsl] Can you group in XSL?
From: "Hewko, Doug" <Doug.Hewko@xxxxxxxxxxxxxxx>
Date: Thu, 12 Jul 2001 09:54:13 -0400
Thanks. Can someone please tell me what I am doing wrong? I went through the
tutorial and I get no output. I do not know if it's because Jeni is loading
her stylesheets from XML files, which I can not do because I want to re-use
my XML files, because she is using SAXON, or some other reason.

I am loading the XML and XSL files from a HTML document and using the
command "return xml.transformNode(xsl);" to give me the output. The code
works find without grouping, but I want to group by category.

Here's my XML file:
ml version="1.0" standalone="no"?> 
<glossaryitem type="dsafasf">
	<category>Category 1</category>
	<english_title>Title 1</english_title>
<glossaryitem type="dsafasf">
	<category>Category 1</category>
	<english_title>Title 2</english_title>

------------------------ XSL file --------------
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="";>
<xsl:key name="sorted-by-category" match="glossaryitemm" use="category" />
<xsl:template match="glossary">
    <xsl:for-each select="glossaryitem[count(. |
	<xsl:sort select="category" />
	<xsl:value-of select="category" />
	<xsl:for-each select="key('sorted-by-category', category)">
		<li><a><xsl:attribute name="href"><xsl:value-of select="uri"
		<strong><xsl:value-of select="uri" /></strong></a>
		<xsl:value-of select="english_description"/></li>
	<tr><td> </td></tr>

-----Original Message-----
From: Rene de Vries [mailto:RdVries@xxxxxxxxxxx]
Sent: July 11, 2001 2:42 AM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Cc: 'Doug.Hewko@xxxxxxxxxxxxxxx'
Subject: RE: [xsl] Can you group in XSL?

Hi Doug,

Mike Kay answered to this question before:

Grouping isn't easy in XSLT 1.0 but you will find a full discussion of the
techniques at

More specific at

Greetings Rene
   { @   @ }

"You don't need eyes to see, you need vision!"

 XSL-List info and archive:

Current Thread