The how to sax example

Martin von Loewis loewis at informatik.hu-berlin.de
Thu May 24 17:24:47 CEST 2001


markhaliday at yahoo.com (Mark H) writes:

> I was playing around last night with the Python Sax How To at:
> http://py-howto.sourceforge.net/xml-howto/node7.html
> 
> And cannot seem to get this code working.  I keep getting an error
> that Default Handler is not part of saxutils.  Indeed when I do a grep
> for DefaultHandler, I don't find it in saxutils.  Any ideas how I can
> get this demo working, or a location for another simple Sax demo in
> Python?

This example requires PyXML (e.g. PyXML 0.6.5), see pyxml.sf.net for
details.

However, the example should really be changed to work with standard
Python 2.1 only. To do so, simply use xml.sax.ContentHandler as the
base class. If you want to use the class also as the error handler,
you need to inherit from xml.sax.ErrorHandler as well.

Regards,
Martin



More information about the Python-list mailing list