OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Primary and Foreign Keys

Sorry about the late reply -- I'm just catching up.

You've missed two options:

5) Nesting. The results from one table are nested inside the results
from another table. Although Thomas pointed out that the dependent table
is usually the child, there is no requirement that this be true. The one
real-world example I've encountered is a sales order for a book, where
the complete part (book) record is a child element. This makes sense,
since it is common to order books that are not stocked in a bookstore
and therefore not already in the database.

6) Leave the key value out of the XML document. This requires that
nesting is used to indicate key relationships and makes sense when: (a)
key values are generated by the database, and (b) the data is being
transferred to a different database. Such values not guaranteed to be
unique in the second database.

Otherwise, I pretty much agree with Thomas.

-- Ron

"Bullard, Claude L (Len)" wrote:
> A more fun question:
> Given a relational database for which one creates a
> parallel XML schema, how do others think key relationships
> should be described:
> 1.  Simple types with the insurance that corresponding
> values exist in both tables (doesn't seem very strong to me).
> 2.  Key/keyrefs
> 3.  ID/IDREFs (probably a non-starter given the caveat)
> 4.  XLinks
> Caveat:  It is usually the case that the schema will be broken
> up into multiple schema given that the original is
> for a very large (field and table wise) relational
> system. Also note, this is going from relational to
> XML Schema, not the other way around.
> Len
> http://www.mp3.com/LenBullard
> Ekam sat.h, Vipraah bahudhaa vadanti.
> Daamyata. Datta. Dayadhvam.h
> ------------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an initiative of OASIS <http://www.oasis-open.org>
> The list archives are at http://lists.xml.org/archives/xml-dev/
> To unsubscribe from this elist send a message with the single word
> "unsubscribe" in the body to: xml-dev-request@lists.xml.org

Ronald Bourret
Programming, Writing, and Training
XML, Databases, and Schemas