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

Tricky inclusion match

Subject: Tricky inclusion match
From: Karl Stubsjoen <kstubs@xxxxxxxxx>
Date: Tue, 29 Mar 2005 07:55:43 -0700
fucia color
Okay,
Lets say you have a set of colors and you have a whole bunch of
pictures and you want to match on all pictures who have one or more of
the given colors but you have to at least match on 2 of them (unique,
so not red and red - so a picture could list red twice but that would
not be a match).  I'm trying to use keys and grouping to solve this
but thinking that I might be making this more difficult.  At any rate,
I'm stuck and would appreciate some help : )

Sample Data (expected results below):

<data>
    <colors>
    	<color>red</color>
    	<color>blue</color>
    	<color>fucia</color>
    	<color>violet</color>
    </colors>
    <pictures>
    	<picture sample="1">
        	<color>black</color>
        	<color>grey</color>
        	<color>white</color>
        </picture>
    	<picture sample="2">
        	<color>red</color>
        	<color>green</color>
        	<color>brown</color>
        	<color>blue</color>
        </picture>
    	<picture sample="3">
        	<color>purple</color>
        	<color>orange</color>
        </picture>
    	<picture sample="4">
        	<color>blue</color>
        	<color>green</color>
        	<color>red</color>
        </picture>
    	<picture sample="5">
        	<color>fucia</color>
        	<color>green</color>
        	<color>violet</color>
        </picture>
    	<picture sample="6">
        	<color>red</color>
        	<color>brown</color>
        	<color>red</color>
        </picture>
    </pictures>
</data>

Expected Results (picture matches based on 2 or more colors used and
listed in colors above)

picture sample #2
picture sample #4
picture sample #5

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.