Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Help! XML Mapping to Relational Database Tables

Reply
Thread Tools

Help! XML Mapping to Relational Database Tables

 
 
Mike
Guest
Posts: n/a
 
      05-27-2004
Hello,

I'm trying to understand how to map hierarchical XML data to relational
database tables, but I seem to be missing something. I'm not a database
expert, but I know the basics. XML seems so much more intuitive to me,
though.

Anyway, let me make up an example: Say we have an address book, in XML
format, that is to be uploaded by a customer and then mapped into relational
database tables. I would start by creating an XML Schema for the address
book. Next, I would create database tables to store the data in.
Alternatively, I know that there are tools that will help you create tables
from an XML Schema, or create an XML Schema from existing tables. My first
question relates to this - should the XML Schema that represents the address
book data format that the user will upload be the same as the XML Schema
that represents the database tables? I mean, the database tables will need
to have a primary key, for example. Using a tool like XML Spy, I see that
you can represent this in XML Schema using a "unique key" constraint. But
it doesn't seem right that the user should be specifying key fields in their
data? It almost seems that the XML Schema for the user data should be
different from the XML Schema that represents the relational tables?

My confusion here started when I tried using XML Spy to create an XML Schema
from a set of database tables, and then tried to apply that same schema to
the data format sent by the user. It doesn't make sense to me that the user
should have to specify the constraints?

Maybe...the address book format for the user data should be a 'fragment',
and the server should insert root tags that specify something like:

<addressBooks> <--------Server Supplied
<userID id="myUserID"> <--------Server Supplied
<addressBook> <--------User Supplied
<contact>
<name>....</name>
<blah>...</blah>
</contact>
</addressBook>
</userID>
</addressBooks>


Anyway, I'm confused...thanks for any help!

Mike


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading XML to relational tables Ted Flethuseo Ruby 3 04-11-2011 07:56 AM
C database :: compared to a relational database engine? sonos C Programming 25 08-31-2007 03:31 PM
Objects/Relational Mapping Software - Which one is the best? NOSPAM ASP .Net 0 10-19-2004 01:37 PM
Objects/Relational Mapping Software - Which one is the best? NOSPAM ASP .Net 0 10-19-2004 01:36 PM
Object relational mapping with Castor D L.Strang Java 0 07-09-2003 03:01 PM



Advertisments