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

Re: database primary keys in XML Schema


xml primary key
> But what if I want to add some cities at a later point?
> My idea was to design my schema in a way that it allows the city element
to
> be declared as document root. Doing so, I can insert only cities (using
the
> same XML Schema as for inserting all three parts together).
> But how can I tell the parser/RDBMS which country/state the cities to be
> inserted belong to?
> One idea I had was to add a attribute to the city element in order to
> specifiy the RDBMS primary key for country. But the XML document creater
must know
> the RDBMS key in advance then ...

IMHO this is not an xml problem. You need to identify the city's "owner" by
something other than its primary key. I guess you have a unique index in the
db on the state table, specifying uniqueness on the combination [state name
or abbreviation + country key].

Or you could look up the state in the db, get its key, and then setup the
xml document.

-tor


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.