Eldrid Rensburg wrote:

How do we convert a well-structured XML file to its corresponding tables in
a MySQL Database ?


With your own Perl/Python/C code ...


And how do we normalize this well-structured XML file prior to conversion ?



By basically tracking how deep you are in the nesting. In Python, you build a mutli-layer dictionary of the XML file and then do something like:


def deconstruct(xmldata, parentdata):
   for item in xmldata:
       if item.has_subitems():
           deconstruct(item, xmldata)
       query = "INSERT INTO %s VALUES (...)" % (xmldata.name, ...)

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to