Jump to content
Sign in to follow this  
Manni1

XML schema for a database exchange format

Recommended Posts

Hello, I want to create an exchange format for copying database objects. After reading some articles about XML schemas I got the impression that I could use XML files for this. Before really starting the implementation I created an XML schema. A very much shortened version is shown here (Verfahren and Verfahrensbeteiligung are tables of the database schema, VER_KEY_ID and VBG_KEY_ID are primary keys and the corresponding foreign keys referencing them) :

<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">	<xs:element name="Verfahrensdaten">		<xs:annotation>			<xs:documentation>Wurzelelement</xs:documentation>		</xs:annotation>		<xs:complexType>			<xs:sequence>				<xs:element name="Verfahren">					<xs:complexType>						<xs:sequence>							<xs:element name="VER_KEY_ID" type="xs:integer" nillable="false"/>						</xs:sequence>					</xs:complexType>				</xs:element>				<xs:element name="Verfahrensbeteiligung" minOccurs="0" maxOccurs="unbounded">					<xs:complexType>						<xs:sequence>							<xs:element name="VBG_KEY_ID" nillable="false"/>							<xs:element name="VER_KEY_ID" type="xs:integer"/>						</xs:sequence>					</xs:complexType>				</xs:element>			</xs:sequence>		</xs:complexType>		<xs:key name="Verfahren_VER_KEY_ID">			<xs:selector xpath="Verfahren"/>			<xs:field xpath="VER_KEY_ID"/>		</xs:key>		<xs:keyref name="Ref_Verfahren" refer="Verfahren_VER_KEY_ID">			<xs:selector xpath="Verfahrensbeteiligung|Verfahrensbeteiligung111"/>			<xs:field xpath="VER_KEY_ID"/>		</xs:keyref>	</xs:element></xs:schema>

A XML file which is generated from this XML schema is e.g. :

<?xml version="1.0" encoding="UTF-8"?><Verfahrensdaten xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Verfahrensdaten.xsd"><Daten>	<Verfahrensdaten>		<Verfahren>			<VER_KEY_ID>99</VER_KEY_ID>		</Verfahren>		<Verfahrensbeteiligung>			<VBG_KEY_ID>1</VBG_KEY_ID>			<VER_KEY_ID>99</VER_KEY_ID>		</Verfahrensbeteiligung>		<Verfahrensbeteiligung>			<VBG_KEY_ID>2</VBG_KEY_ID>			<VER_KEY_ID>99</VER_KEY_ID>		</Verfahrensbeteiligung>	</Verfahrensdaten></Daten>

Of course, in reality there are more tables and for each of them more attributes.Are there experiences with such a type of exchange format ? Is XML an option which makes sense at all for exporting and importing database tables from one database to another ?

Share this post


Link to post
Share on other sites

Hello,I was a bit surprised to see that nobody has still answered to my problem. I thought that exchanging objects between databases is one of the main applications for XML files. Maybe this is only theory and one day everybody will say : "Of course theoretically this was one of the main applications, but in practice it could not be managed to adapt the XML schema to changes of the database schema(s). Often it was too complex to do this manually, and there were no tools for managing this automatically." This idea I got when I read the articles of mojojojo (Tools for schemas).But nevertheless I am looking forward to posts from readers having some experiences in exporting and importing database tables with an XML based exchange format (or some other format).

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...