Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

XML+DTD to mySQL conversion

Posted on 2009-04-28
3
Medium Priority
?
1,145 Views
Last Modified: 2012-05-06
Dear experts,

I've got a fairly advanced XML document, and I would like to get this document ported to mySQL. Now I'm expecting to have to manually map entities to tables and create a shitload of extra tables to map relations....but I figure it'd be worth a shot asking here if someone knows of a good tool to help me with this conversion. And perhaps some other tips/ideas. I know, XML rocks, and usually the conversion is the other way around...but I'm afraid there is no other way. I've included a small part of the DTD for the XML doc as an example.
<!ELEMENT entry      (biblref, bdate, thesid+, analytic?, (monogr, series*)+, 
                                                      (note|idno)*)                  >
<!ELEMENT biblref    (#PCDATA | em)*                                              >	 
<!ATTLIST biblref  id    ID                             #REQUIRED
                   name  CDATA                          #REQUIRED                    >
 
<!ELEMENT bdate      (#PCDATA)                                                    >
<!ELEMENT thesid     (#PCDATA)                                                    >
 
<!ENTITY % title "title">
<!ELEMENT title      (#PCDATA | em | sup)*                                    >
<!ATTLIST   title   type   (ana|mon|ser|txt|col)           #REQUIRED   >

Open in new window

0
Comment
Question by:Azhrei1
  • 2
3 Comments
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 24249079
I remember a tool from Altova ... Map Force.

http://www.altova.com/products/mapforce/data_mapping.html
0
 
LVL 20

Accepted Solution

by:
ChristoferDutz earned 2000 total points
ID: 24249087
As this is a commercial (and as it's from Altova ... propable pretty expensive) ... I just googled a little. Maybe this helps: http://www.xml.com/pub/a/2001/05/09/dtdtodbs.html?page=4#generate
0
 
LVL 6

Author Closing Comment

by:Azhrei1
ID: 31575348
I decided to go the manual way. There are alot of tools, but those I tried rarely got an efficient mySQL design. They did give me ideas though, on which to base my own design. Translating elements to tables, attributes or single sub elements to collums and translating deeper elements with new tables and coupling them with a relational table. (FKEY1, FKEY2)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Among the most obnoxious of Exchange errors is error 1216 – Attached Database Mismatch error of the Jet Database Engine. When faced with this error, users may have to suffer from mailbox inaccessibility and in worst situations, permanent data loss.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question