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 ]

Hi David,

it would be great if you sent an example. I did not completely understand
your solution and therefore I think it might be good to "see it" working ...

Thanks, Markus

> We have implemented business keys (primary keys) within individual XSD 
> (schemas) using a non-instantiated element (definition of the key but
> cannot be placed into the XML document) 
>  -- The element upper and lower bounds are both 0.  This allows us to tell
> 
> the parser the key of the message so that is can be shredded into database
> 
> staging table.  The parser is SAX based an is configured with XML.  Very 
> nice use of technologies.
> 
> Our XSDs do not map directly to tables but to key messages that the 
> consumer needs.  Sometimes they are parts of one table, other times they 
> are multiple.   Hope this helps.  I can send an example to help clarify.
> 
> 
> 
> 
> 
> Michael Kay <michael.h.kay@ntlworld.com>
> 02/13/2004 07:19 AM
> Please respond to michael.h.kay
> 
>  
>         To:     "'Markus Seibold'" <Markus.Seibold@gmx.net>,
> xml-dev@lists.xml.org
>         cc: 
>         Subject:        RE: [xml-dev] database primary keys in XML Schema
> 
> 
> Your XML schema describes constraints on a single document. A single
> document probably corresponds to a "business object" held in your
> database. The XML Schema cannot describe constraints that apply across
> documents. Perhaps this is where your difficulty lies.
> 
> Michael Kay
> 
> > -----Original Message-----
> > From: Markus Seibold [mailto:Markus.Seibold@gmx.net] 
> > Sent: 12 February 2004 19:29
> > To: xml-dev@lists.xml.org
> > Subject: [xml-dev] database primary keys in XML Schema
> > 
> > 
> > Hello everybody,
> > 
> > I am developing a XML Schema which should function as an 
> > interface to a relational database. I have problems with how 
> > to design the primary keys in XML Schema.
> > 
> > 1.) When I insert data via XML instance documents the first 
> > time, I cannot specify a primary key in my XML instance 
> > document because the database automatically creates an 
> > auto-increment key. Correct?
> > 
> > 2.) What if I, for example, want to insert a city in a 
> > geography database (the database has a Country and a City 
> > table; 1:n relationship). When inserting a city, how can I 
> > specify to which country the city belongs? I needed to know 
> > the database primary key for the country, wouldn't I and add 
> > this key as an attribute to the city in my instance document? 
> > What other solutions do exist?
> > 
> > This issue cost me alot of time so far and I would really 
> > appreciate any help!
> > 
> > Thanks a lot, Markus
> > 
> > 
> > -----------------------------------------------------------------
> > 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 subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>
> 
> 
> -----------------------------------------------------------------
> 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 subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>
> 
> 
> 
> 

-- 
Markus Seibold
------------------------------
Krebsgasse 6
D-93047 Regensburg
Germany
------------------------------
Email: markus.seibold@gmx.net
Phone: +49 (941) 504 1009
Mobile: +49 (171) 212 6869
FAX: +49 (89) 1488 210457





 

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

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