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

Generating a unique listing of elements from multiple

Subject: Generating a unique listing of elements from multiple sets
From: Glen Mazza <grm7793@xxxxxxxxx>
Date: Wed, 24 Jan 2007 09:54:22 -0800 (PST)
 Generating a unique listing of elements from multiple
Hello,

I have an XSLT 1.0 problem that I'm finding rather
difficult to solve.  I have a list of countries that
are placed into country groups, but countries may be
duplicated in multiple groups.  I also have a list of
businesses that have a listing of country groups that
they do business in.

For each business, I need a list of *unique* countries
affiliated with each business.

Sample input:

<data>
   <countries>
     <country id="1">United States</area>
     <country id="2">Canada</area>
     <country id="3">Mexico</area>
     ...
   </countries>
   <countryGroups>
	<countryGroup groupID="4">
		<country included="2"/>
		<country included="3"/>
	</countryGroup>
	<countryGroup groupID="5">
		<country included="3"/>
	</countryGroup>
	<countryGroup groupID="6">
		<country included="1"/>
		<country included="3"/>
	</countryGroup>
        ...
   </countryGroups>
   <businesses>
      <business>
	<name>Acme</name>	
	<countryGroup included="6"/>
      </business>
      <business>
	<name>Another Acme</name>
	<countryGroup included="4"/>
	<countryGroup included="5"/>
      </business>
      ...
   </businesses>
</data>

Desired output:
Acme              United States, Mexico
Another Acme      Canada, Mexico  [Mexico *not* listed
twice despite being in both groups defined for this
business]

Any help would be much appreciated!

Thanks,
Glen



 
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

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-2011 All Rights Reserved.