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

many-to-many

Subject: many-to-many
From: "Brown, William S" <wsbrown@xxxxxxx>
Date: Fri, 26 Jan 2007 15:29:51 -0500
 many-to-many
Esteemed experts,
There are a number of examples out there on the net of modelling
'many-to-many' relationship in XML.
A recent one is
http://en.wikibooks.org/wiki/XML:_Managing_Data_Exchange/The_many-to-many_rel
ationship
and it is helpful, as far is it goes.
However, Kevin Williams points out in
http://www-128.ibm.com/developerworks/xml/library/x-xdm2m.html
that the usual understanding of the 'many-to-many' relationship is that it is
a two-way street.

That is, to use an example from the first document, I can structure data about
movies and actors such that each actor's info is represented only once in the
XML but pulled out repeatedly as I generate a list of movies and the many
actors that appeared in each; same actors appear in multiple movies.
Or, to use the classic example, I can represent details for each part only
once, but re-use it as I generate invoices, each of which contains many of the
same parts.
Each of the above articles suggests an ID/IDREF approach for doing this.
However, Williams notes that in relational databases it is simple to run the
query in reverse, i.e., list the movies that each actor has appeared in, or
list the invoices on which each part appears. Since the ID/IDREF is treated as
unidirectional, he suggests a double IDREF structure - paired pointers
pointing in opposite directions.
Which brings me to my question -
has anyone seen any sample xml/xsl that actually demonstrated running the
query in forward and reverse. Everything I've seen uses ID/IDREF and xsl:key
in one direction and calls that a 'many-to-many' structure. But I'm not clever
enough to navigate back upstream (William implies it can't be done) or to
implement the XSL for the dual ID/IDREF.
The first (wiki) article contains sample xml and xsl for anyone who wants to
investigate the issue.
I hope you find this diverting (or at least can show me how to do it LOL).

Best,

William S. Brown              wsbrown@xxxxxxx
Systems Engineering and Safety Analysis Group
Brookhaven National Laboratory
Building 130                 TEL 631 344 7230
Upton, NY 11973-5000         FAX 631 344 4900

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.