xml.sax in Python 2.3.4

Uche Ogbuji uche at ogbuji.net
Sat Dec 4 23:09:36 CET 2004


Gustaf Liljegren <gustafl at algonet.se> wrote in message news:<collri$jgv$1 at yggdrasil.glocalnet.net>...
> After a long break with Python I'm trying to get started again. I need 
> to do some SAX processing, but it seems things have changed, and I can't 
> find any docs describing how to make things work *today*. The SAX 
> example in the XML HOWTO [1] doesn't work anymore. I get this error:
> 
> D:\Test>python comics.py
> Traceback (most recent call last):
>    File "comics.py", line 5, in ?
>      class FindIssue(saxutils.DefaultHandler):
> AttributeError: 'module' object has no attribute 'DefaultHandler'
> 
> I hope someone here can explain what has changed and how a working 
> example looks today. My needs are very simple, so don't want to install 
> any packages on top of the standard distribution.
> 
> 1. http://pyxml.sourceforge.net/topics/howto/node12.html

Things have certainly changed since all that.  You can easily correct
your own sample code using the standard Python docs:

http://python.org/doc/current/lib/module-xml.sax.html

Which I admit could be better organized (nor would more examples
hurt).  See also my Akara page on Python/SAX

http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/sax

I have a lot on SAX in recent installments of my column:

http://www.xml.com/pub/au/84


-- 
Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Use CSS to display XML -
http://www.ibm.com/developerworks/edu/x-dw-x-xmlcss-i.html
Location, Location, Location -
http://www.xml.com/pub/a/2004/11/24/py-xml.html
The State of Python-XML in 2004 -
http://www.xml.com/pub/a/2004/10/13/py-xml.html
Be humble, not imperial (in design) -
http://www.adtmag.com/article.asp?id=10286XMLOpen and more XML Hacks -
http://www.ibm.com/developerworks/xml/library/x-think27.html
A survey of XML standards -
http://www-106.ibm.com/developerworks/xml/library/x-stand4/



More information about the Python-list mailing list