XML file for a database

A

Allan Martin

Hello,

I would like to create a XML document but have never done one before.
I have a rough understanding of how XML works, but am still learning
most of it as I go along.

The XML document which I would like to create is to apply data to a
database, for now SQL Server.

The idea is that I pass the XML document to another application
(written in Java) and it will interrogate the XML and apply the
changes to the database.

I had the following idea, but not sure if it's correct.

<header>
<table_structure>
<table1> column1, column2, column3, column4....... </table1>
<table2> column1, column2, column3, column4, column5 </table2>
e.t.c.
</table_structure>
</header>

<body>
INSERT TABLE1 data1, data2, data3, data4
INSERT TABLE1 data1, data2, data3,data4
INSERT TABLE2 data1, data2, data3,data4,data5
INSERT TABLE1 data1, data2, data3,data4
INSERT TABLE2 data1, data2, data3,data4,data5
</body>

This is something which I came up with before doing any research. If
anyone could point me in the right direction, or offer me advice or a
examples I would be very grateful.

Many thanks in advance,

Allan Martin
ps. (e-mail address removed) is an e-mail address which I don't use as
it gets bombarded with junk e-mail.
 
E

Ed Beroset

Allan said:
Hello,

I would like to create a XML document but have never done one before.
I have a rough understanding of how XML works, but am still learning
most of it as I go along. [...]
I had the following idea, but not sure if it's correct.

<header>
<table_structure>
<table1> column1, column2, column3, column4....... </table1>
<table2> column1, column2, column3, column4, column5 </table2>
e.t.c.
</table_structure>
</header>

<body>
INSERT TABLE1 data1, data2, data3, data4 [...]
This is something which I came up with before doing any research. If
anyone could point me in the right direction, or offer me advice or a
examples I would be very grateful.


One fundamental difference between XML and an HTML-ish approach like
you've outlined above is that there is a separation of the data from the
presentation. So instead of choosing tags like "header" and "body"
which imply the presentation of the data but don't tell anything about
the data itself, we tend to use XML to describe the actual data and then
other tools, like XSL, to transform that into whatever presentation form
we wish. For example, let's say that your records were about books.
XML records might look something like this:

<book>
<title>How To Write XML</title>
<author>A. Writer</author>
<isbn>1233435322X</isbn>
<publishyear>2002</publishyear>
</book>

Note that the structure is based on the semantic content of the data,
and not the eventual layout. As you continue your research, it's
essential to keep this distinction in mind.

Ed
 
J

Joel Witherspoon

Hello,

I would like to create a XML document but have never done one before.
I have a rough understanding of how XML works, but am still learning
most of it as I go along.

The XML document which I would like to create is to apply data to a
database, for now SQL Server.

The idea is that I pass the XML document to another application
(written in Java) and it will interrogate the XML and apply the
changes to the database.

I had the following idea, but not sure if it's correct.

<header>
<table_structure>
<table1> column1, column2, column3, column4....... </table1>
<table2> column1, column2, column3, column4, column5 </table2>
e.t.c.
</table_structure>
</header>

<body>
INSERT TABLE1 data1, data2, data3, data4
INSERT TABLE1 data1, data2, data3,data4
INSERT TABLE2 data1, data2, data3,data4,data5
INSERT TABLE1 data1, data2, data3,data4
INSERT TABLE2 data1, data2, data3,data4,data5
</body>

This is something which I came up with before doing any research. If
anyone could point me in the right direction, or offer me advice or a
examples I would be very grateful.

Many thanks in advance,

Allan Martin
ps. (e-mail address removed) is an e-mail address which I don't use as
it gets bombarded with junk e-mail.



Allan,
Look up the O'reilley (sp?) or the w3 groups XML sites.

Wrox has a good beginner book on XML, also.
 
A

Akmal B. Chaudhri

Hello,

I would like to create a XML document but have never done one before.
I have a rough understanding of how XML works, but am still learning
most of it as I go along.

The XML document which I would like to create is to apply data to a
database, for now SQL Server.

The idea is that I pass the XML document to another application
(written in Java) and it will interrogate the XML and apply the
changes to the database.

[snip]

Allan,

If you are interested in the storage and retrieval of XML Documents in a
Relational Database System, then there are quite a few ways to do it. The
major vendors have also added capabilities to do this with their more
recent offerings.

There are several books around as well that you could have a look at,
including "Professional XML Databases", Kevin Williams (Wrox Press) and
"Designing XML Databases", Mark Graves (Prentice-Hall).

I also helped put together a book, "XML Data Management":

http://www.awprofessional.com/titles/0201844524/

There are chapters that describe DB2, Oracle and MS SQL Server as well as
a couple of roll-your-own techniques; one based upon the work by Dr.
Richard Edwards which you can grab from sourceforge:

http://minx.sourceforge.net/

Several other sites to look at:

http://www.oasis-open.org/cover/xmlAndDatabases.html
http://www.rpbourret.com/xml/

HTH and Kind Regards,

akmal
 
S

sorros

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top