[lxml-dev] Is there a 'Generic' XML-to-Relational Database Program?

Hi All, 1. Is there a python (UTILITY) program that converts 'any' XML to Relational Database program (which uses, say, lxml)? So, the utility program should not only parse the xml, but also understand the most general 'hierarchical' structure of the elements, create tables (say in sqlite) accordingly and insert the data. I have seen many relational DB to xml programs, but I haven't come across one that does the opposite. 2. Is there a UTILITY (program) whtat diplays the most general hierarchical structure of the elements as a tree (or as an expandable/collapsable list). 3. Is there a program which helps me to filter elements (in an xml file)? Supposing we were able to see the results of 2 (above), we then should be able ask for something like -- "discard all elements which do not have xyz and create a new file." Is there a pre-built UTILITY for doing such a thing? If nothing pre-build is available, I am gonna build them now. But I would love NOT to reinvent the wheel. Guru's on the forum, please advise. Regards, Datta. Graduate Student, UMICH.

On Wed, 2009-12-30 at 14:48 -0500, Dattatreya Mellacheruvu wrote:
<snip>
<snip> First, if you do go down the path of trying to jam XML in a relational database, you'll probably want to start with an XML schema of some sort rather than just plain XML. Trying to infer structure (and data type!) information from random XML sounds like a very hard, if not impossible, problem. You could take a look at some of the automatic XML schema generation tools to get an idea of what the hard problems are, since that's essentially what you'd need to do as a first step. But, if your goal is to store random XML in a database, are you sure you should be looking at relational databases? You might find that a native XML database based on XQuery (such as eXist: http://www.exist-db.org/) solves your problem space in a much more elegant way. -- John Krukoff <jkrukoff@ltgc.com> Land Title Guarantee Company

On Wed, 2009-12-30 at 14:48 -0500, Dattatreya Mellacheruvu wrote:
<snip>
<snip> First, if you do go down the path of trying to jam XML in a relational database, you'll probably want to start with an XML schema of some sort rather than just plain XML. Trying to infer structure (and data type!) information from random XML sounds like a very hard, if not impossible, problem. You could take a look at some of the automatic XML schema generation tools to get an idea of what the hard problems are, since that's essentially what you'd need to do as a first step. But, if your goal is to store random XML in a database, are you sure you should be looking at relational databases? You might find that a native XML database based on XQuery (such as eXist: http://www.exist-db.org/) solves your problem space in a much more elegant way. -- John Krukoff <jkrukoff@ltgc.com> Land Title Guarantee Company
participants (2)
-
Dattatreya Mellacheruvu
-
John Krukoff