[xsl] Meunchian Method - Grouping with attributes

Subject: [xsl] Meunchian Method - Grouping with attributes
From: "Magick, Brian" <Brian.Magick@xxxxxxxxxx>
Date: Fri, 25 Jan 2002 15:56:01 -0600
I'm having a tough time grouping on an attribute where I need to get
only unique values of the domain attribute for each unique technology.
The problem is that the technology element is unbounded and repeats as a
child of the unbounded product element.  Looking at the XML below we see
that tech 1 belongs to both Product 1 and Product 2 and has a domain
attribute of xyz and abc.  Whenever I group and output the values to get
each unique domain I always get repeating domain values.  So grouping on
Tech 1 I would get 2 values for domain=xyz and 2 values for domain=abc
(since the domain has these values in both Product 1 and Product 2).

I've been trying to set the key as <xsl:key name="domain4tech"
match="technology/@domain" use="technology"/> but this has proved
useless.  Any suggestions?

Here's an example of the output I'm looking for.

Technology 1
	domain = xyz
	domain = abc

Technology 2
	domain = xyz
	domain = abc
	domain = zzz
	domain = xxx

Technology 3
	domain = xyz
	domain = aaa

-------------------------------
Here's the XML

<document>
   <products>
 	<product>Product1
	   <technology domain="xyz">tech1</technology>
	   <technology domain="abc">tech1</technology>
	   <technology domain="xyz">tech2</technology>
	   <technology domain="xxx">tech2</technology>
         <technology domain="xyz">tech3</technology>
      <product>
	<product>Product2
	   <technology domain="xyz">tech1</technology>
	   <technology domain="abc">tech1</technology>
	   <technology domain="zzz">tech2</technology>
	   <technology domain="xxx">tech2</technology>
         <technology domain="aaa">tech3</technology>
      <product>
    <products>
<document>

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


Current Thread