Converting xml schema to relational model

niceApp picture niceApp · Nov 4, 2009 · Viewed 12k times · Source

Do you guys know, how we can convert XML Schema to relational model? What are the steps involved? More precisely, How can we figure out what the table names, columns names and the relationships on those tables, going to be like on relational model by looking only at the XML Schema?

If you have any tutorial links, examples then please share it with me. I hightly appreciate your help on this.

THanks

Answer

duffymo picture duffymo · Nov 4, 2009

The two are inherently different. The relational model is set-based; XML is hierarchical.

One way might be to make the tag name the name of the table IF the tag has multiple child with leaf grandchildren. The child tag name would be the column, and the grandchild text the value.

If the children have non-leaf grandchildren, model these as one-to-many relationships between parent and child table.

There are several papers to be had if you Google "XML schema to relational schema", including these:

  1. http://www.cobase.cs.ucla.edu/tech-docs/dongwon/ecaiot02.pdf
  2. http://msdn.microsoft.com/en-us/library/aa905914(SQL.80).aspx
  3. http://msdn.microsoft.com/en-us/library/bfdchewb(VS.71).aspx