[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: database primary keys in XML Schema
> 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|