Help! XML Mapping to Relational Database Tables

Discussion in 'XML' started by Mike, May 27, 2004.

  1. Mike

    Mike Guest

    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
     
    Mike, May 27, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. NOSPAM
    Replies:
    0
    Views:
    313
    NOSPAM
    Oct 19, 2004
  2. NOSPAM
    Replies:
    0
    Views:
    365
    NOSPAM
    Oct 19, 2004
  3. D L.Strang
    Replies:
    0
    Views:
    555
    D L.Strang
    Jul 9, 2003
  4. sonos
    Replies:
    25
    Views:
    928
    Tor Rustad
    Aug 31, 2007
  5. Ted Flethuseo

    Reading XML to relational tables

    Ted Flethuseo, Apr 1, 2011, in forum: Ruby
    Replies:
    3
    Views:
    130
    Jesús Gabriel y Galán
    Apr 11, 2011
Loading...

Share This Page