Article Friendly article publishing script homepage.
Translate Page To German Tranlate Page To Spanish Translate Page To French Translate Page To Italian Translate Page To Japanese Translate Page To Korean Translate Page To Portuguese Translate Page To Chinese
  Number Times Read : 10    Word Count: 651  
Stats
Total Articles: 538419
Total Authors: 44726
Total Downloads: 2363136


Newest Member
oden chris

Your Advertisement Here
 
You are at : Home | Databases


   

The Way To Map An XML Database Through An XML Schema (XSD)



[Valid RSS feed]  Category Rss Feed - http://www.netarticledirectory.com/rss.php?rss=66
By : michael dupre    9 or more times read
Submitted 2012-02-07 03:21:30
Computer programmers frequently run into the necessity to change the procedure they work with their databases, normally, this is the case when say, as a engineer you actually are working on a web software package or perhaps software project so you realize you should improve your data mid flow, as an example, shifting from xml data to a relational database.

I have quite often worked on projects in which the desired goals have changed and perhaps, new technologies are already brought in which has necessitated the need for a new data methodology.

Having effectively mastered this type of changeover in large projects, the position itself is in no way a tricky one; the main issue is in mapping the data layout between your sender and the destination data.

A sensible way to achieve this is using an xml schema (xsd for short), essentially an xml schema is a approach to summarize the structure and content of an xml data source. The schema sets out the foundations of an xml file, similar to a DTD. Meaning that the schema will set out to explain the elements, attributes, child elements, order and number of child elements etc that may appear in the xml data source.

So that you can map your xml database, you can utilize the following options, at this moment there is no such thing as a one recommended system or indeed procedure to adhere to, the below solutions can be viewed as several sensible steps. I would also add that the solution you take is going to be influenced by your own particular circumstances, such as the nature and kind of data you intend to map.


Element To Table Mapping

Changing xml elements into relational database tables can be the most plausible path to take, however it's not absolutely the best, its appropriateness will likely be contingent on your data. By way of example, mapping an element right into a database table will certainly transform the columns to element attributes or the element content into children and so forth.

To map a target element to a relational database table, simply setup the mapping node to collect the relevant rows from the database, then populate the target elements with values out of your database.


Element To Column Mapping

Mapping elements to columns in your relational database is recommended when you've got simple elements that have only text string, if your elements consists of further elements or attributes, your mapping is not as likely to achieve success. By default, an element and also attribute of basic type, maps to the column with the same name in the table.

In the example below, the [Person.Person] element is of complex type and, due to this fact, maps by default to the Person.Person table in the selected database. All of the attributes (BusinessEntityID, FirstName, LastName) of the [Person.Person] element are of simple type and map by default to columns with the same names in the Person.Person table.

[xsd:schema xmlns:xsd=".w3.org/2001/XMLSchema"]

[xmlns:sql="urn:schemas-mysite-com:mapping-schema"]

[xsd:element name="Person.Person"]

[xsd:complexType]

[xsd:attribute name="BusinessEntityID" type="xsd:string"/]

[xsd:attribute name="FirstName" type="xsd:string"/]

[xsd:attribute name="LastName" type="xsd:string"/]

[/xsd:complexType]

[/xsd:element]

[/xsd:schema]


Attribute To Column Mapping

Attribute to column mapping will work better when you would like to map the attributes into columns inside your relational database tables, complimenting them to their given elements. The exemption is in which you only have a given quantity of possible attribute values, in this scenario it may be preferable to have different tables for the elements needing each attribute type.

Let’s say you've an element called “brick”, containing an attribute called “colour”, and the attributes can only be “red” or “grey”, you could manage this step by setting two tables, one for red bricks and the other for grey bricks.




























































































































































































































































Author Resource:- Michael Dupre is truly an veteran expert in XML programming and XML standards and possesses an abundance of working know-how about Data Mapping as well as strongly proposes anyone to Data Mapper.
Article From Net Article Directory

Related Articles

HTML Ready Article. Click on the "Copy" button to copy into your clipboard.




Firefox users please select/copy/paste as usual
Rate This Article
Vote to see the results!

Do you like this article?
  • Yes.
  • Not Sure.
  • No.
Like This Page?
Tweet It!


Click Here to invite your friends to see this page


New Members
select
Sign up
select
learn more
Click This Link to refer your friends to this page
Refer Your Friends
 
Nav Menu
Home
Login
Submit Articles
Submission Guidelines
Top Articles
Link Directory
About Us
Contact Us
Privacy Policy
RSS Feeds

Actions
Print This Article
Add To Favorites





 
Sponsors

Purchase this software

Affiliate Signup
Marketing Article Feed