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

grouping references so that they only appear once

Subject: grouping references so that they only appear once
From: "Rick Geimer" <Rick.Geimer@xxxxxxx>
Date: Wed, 28 May 2003 16:01:48 -0700
rebok
Hello,

I have a grouping problem that I am hoping someone can help me with.
Imagine that I am transforming the following instance, and that I am
currently processing the category element with  the id "shoes".

<?xml version="1.0"?>
<doc>
      <categories>
            <category id="shoes">Shoes</category>
            <category id="clothes">Clothing (General)</category>
      </categories>

      <makers>
            <maker id="nike">Nike</maker>
            <maker id="rebok">Rebok</maker>
      </makers>

      <products>
            <product>
                  <name>Shoe1</name>
                  <categoryRef idref="shoes"/>
                  <categoryRef idref="clothes"/>
                  <makerRef idref="nike"/>
            </product>
            <product>
                  <name>Shoe2</name>
                  <categoryRef idref="shoes"/>
                  <categoryRef idref="clothes"/>
                  <makerRef idref="nike"/>
            </product>
            <product>
                  <name>Shoe3</name>
                  <categoryRef idref="shoes"/>
                  <categoryRef idref="clothes"/>
                  <makerRef idref="rebok"/>
            </product>
      </products>
</doc>

I want to get a list of all the makers that have products that reference
the shoes category, but I don't want a single maker to appear more than
once. I have been able to use keys to gather a list of products that
reference a category, and from there I can get the makerRefs, and with
another set of keys I can then get the makers, but I can't see how to
ensure that each maker is only listed once since multiple products
reference the same makers.

Any help would be appreciated.

Rick




 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.