June 2000
Intermediate to advanced
556 pages
8h 45m
English
Now that we have the overall structure of a working driver, we can flesh out the template to make it work with MySQL.
CD-ROM reference=15018.txt C>type drv_mysql.py """ MySQL SAX driver Sean Mc Grath and Noel Duffy XML Processing with Python """ import sys,os,string import MySQL from xml.sax import saxlib,saxutils # SAX_MySQL #___________ class SAX_MySQL(saxlib.Parser): """ Implements the SAX parser interface for the MySQL relational database """ def __init__(self): saxlib.Parser.__init__(self) self.db = None self.DatabaseName = None self.QueryExpression = None def parse(self,sysID): # User specifies a database and an SQL # expression separated by a space. if string.count (sysID," ") >= 1: first = string.find(sysID," ...
Read now
Unlock full access