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

Intersection of two sets based on a subset of fields?

Subject: Intersection of two sets based on a subset of fields?
From: "Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 May 2020 14:16:45 -0000
 Intersection of two sets based on a subset of fields?
Hi Folks,

I have a set of Book instances. I call this Set #1. Here are two instances:

<Book>
    <Title>ABC</Title>
    <Author>John Doe</Author>
    <Country>USA</Country>
    <Binding>hardcover</Binding>
</Book>

<Book>
    <Title>XYZ</Title>
    <Author>Mary Sue</Author>
    <Country>CAN</Country>
    <Binding>hardcover</Binding>
</Book>

I have a set of Music instances. I call this Set #2. Here is one instance:

<Music>
    <Genre>Classical</Genre>
    <Author>John Doe</Author>
    <Country>USA</Country>
    <Cost>9.95</Cost>
</Music>

Query: Find the subset of Set #1 that intersects with Set #2 at the <Author>
and <Country> elements.

If Set #1 consists of the two instances shown above and Set #2 consists of the
one instance shown above, then the result of the query is the following:

<Book>
    <Title>ABC</Title>
    <Author>John Doe</Author>
    <Country>USA</Country>
    <Binding>hardcover</Binding>
</Book>

That Book instance has an <Author> and <Country> that intersects with the
<Author> and <Country> in the Music instance.

I view this as an intersection problem. However, it is an intersection at
specific fields (the Author and Country fields). Do you view it as an
intersection problem?

If it is viewed as an intersection problem, then is there a nice XPath
expression that does intersection-at-specific-fields?

If it is better viewed not as an intersection problem, then how is it better
viewed? is there a nice XPath expression for that view?

/Roger

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.