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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] database primary keys in XML Schema

[ Lists Home | Date Index | Thread Index ]

> 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





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS