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

RE: xml spec 1.0 validity constraint for ID/IDREF

  • From: Kevin Williams <Kevin.Williams@u...>
  • To: Xml-Dev <xml-dev@x...>
  • Date: Wed, 29 Mar 2000 15:55:41 -0500

RE: xml spec 1.0  validity constraint for ID/IDREF
> -----Original Message-----
> From: Peter Murray-Rust [mailto:peter@u...]
> Sent: Wednesday, March 29, 2000 8:30 AM
> To: gopi; Xml-Dev
> Subject: Re: xml spec 1.0 validity constraint for ID/IDREF
> 
> My suggestion - FWIW is that you use a separate attribute or 
> PCDATA for
> your foreign key, and write your "application" to take care 
> of uniqueness.
> It is a good example of the fact that XML is not a magic bullet which
> solves all your problems. But it does help to identify them 
> and XML-DEV
> helps to encourage people to solve them.

One approach that I have taken for some of the systems I have designed is to
prefix the (integer) key with the element name, or some portion thereof. For
example, we might have:

<Borrower 
  BorrowerID="Borrower18273" 
  FirstName="Kevin"
  LastName="Williams"/>

for a borrower in our Borrower table with the key 18273.

Since our data is coming from a relational database, prefixing the key with
the element (table) name guarantees uniqueness across all documents that can
be created from the RDB. The bonus is that if the receiving system is using
the same key structure (as it is in our case), the key may be used as
provided (after ripping off that pesky prefix). We needed some sort of
prefix anyway, since we might have a Borrower 18273 and an Asset 18273, so
this change didn't bother us too much. I have to admit, though, I initially
had the same annoyed reaction when I discovered I couldn't just use my keys
directly...

- Kevin

***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.