June 2000
Intermediate to advanced
556 pages
8h 45m
English
In this section, we develop a template Python SAX driver called template that will illustrate the overall structure of a Python SAX driver. Once this template works, we will customize it for MySQL.
CD-ROM reference=15016.txt
C>type drv_template.py """ Python SAX template driver """ import sys,os,string from xml.sax import saxlib,saxutils # SAX_template #_________________ class SAX_template(saxlib.Parser): """ Template implementation of a SAX parser driver """ def __init__(self): saxlib.Parser.__init__(self) def parse(self,sysID): # Call the start of document handler. self.doc_handler.startDocument() # Start an element called template with no # attributes. self.doc_handler.startElement ( "template", saxutils.AttributeMap({})) ...Read now
Unlock full access