Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML to Database

Status
Not open for further replies.

eric91850

Programmer
Jul 29, 2007
12
US
Am now using SQLXML to load XML file into a SQLServer database.

Here is how it works -

XML(Data) + XSD(Schema) -->

through MS SQLXML COM program (EXE) -->

SQLServer2005

==================

I though XML Schema is used for defining what kind of Element or
attribute should appear in an XML document right?

But from above example, XSD schema can also used to describe how XML
document should be map to a Database table too???

Then XSD can be think of a document that describe how One want to
manipulate a specific XMLfile?

So, XSD schema to be used to describe anything about data manipulate
of an XML???

Why not just use another XML to describe how to map data to database table??

One can define a custom XML to describe on table mapping right??

Why one need to study the XSD schema syntax (which is very complex) then use XSD to define the mapping to tables?
 
The schema is just like a contract between the two parties. The schema is sufficiently extensible, yes because it is as well an xml document by its own, to accommodate some devices, "annotations", which in additional to describing the xml document's structure. to give instructions to the other party, ie the sql service provider, how to do with the data (either reading/inputting or writing/outputting).

The xml document prepared (by the client) or resulted (streamed out) from the server will have to respect the schema's description of the xml document, (yes, its semantic in a sense) and then the server has to behave by what have to bind to the "contract" in the mapping or the querying or the updating. For the latter, any other parties outside of the "privacy" of the "contract" won't be bound to the terms and, in fact, apriori don't know how to behave with those annotations destined to be consumed by the server bound to the "contract". The client, the same, is bound to the "contract" to make a sense out of the output or to make a discourse for the server to understand.

Why don't you look at some of the annotated schemas to get a feeling of that? rather than just imagining in a vacuum? Say, for instance, a simple google have these amongst many others.

I would leave other members who have deeper and more practical experience on the matter for further elucidation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top