[XML-SIG] ODBC-XML-Interface

Mike Orr iron@mso.oz.net
Mon, 4 Dec 2000 16:27:44 -0800


On Tue, Dec 05, 2000 at 12:06:07AM +0100, Martin v. Loewis wrote:
> > Is there any Python SAX2-Driver available that parses Databases via
> > Python Database API.
> 
> I guess the answer to that question is "no"; I couldn't really tell
> what "parsing a database" would mean when it comes to XML files. An
> XML file is a byte sequence in some specific format, and a parser
> analyses its structure. A database typically is a byte sequence (or
> several of them) in a totally different structure, and an DBMS is used
> to access the bytes.

Dunno if this'll help, but just in case...

I've been thinking for a while about XML's relationship to databases and
evaluating its use as an "editing UI" for the (MySQL) databases.  It
would involve converting a database structure to XML and back, although
not using the Database API for the XML part.  My idea was to use a list
(the rows) of dictionaries (each record) as the intermediate format and
to make it "generic" for a variety of databases.  In this case, one
level of XML tags would correspond to the records, and the child level
would be the fields.  A parent level could then mean "tables", if that
was desired.  (And the script would then have to check referential
integrity after the edit.)  I've done a few prototype tests and am
undecided whether to proceed at this point.

It's hard to imagine how one would write a Database API driver for XML.
XML has no native concept of "this is a record level" and "this is a
field level"; the application or DTD has to infer this.  XML just has
an arbitrary nesting of tags.  So for a database driver to extract
	SELECT name, phone FROM contact_manager.phone_list
	WHERE name LIKE "Mc%" ORDER BY name
from an XML file, the file would have to conform to a specific DTD, it
couldn't be just any XML file.  At that point, one wonders whether
perhaps either XML or the Database API should be thrown out of this
project.  Because either the project belongs more naturally to one or
to the other.

-- 
-Mike (Iron) Orr, iron@mso.oz.net  (if mail problems: mso@jimpick.com)
   http://mso.oz.net/     English * Esperanto * Russkiy * Deutsch * Espan~ol