registering entities with sax parser

Ralf Schmitt ralf at
Tue Jun 8 18:55:10 CEST 2004

is there a way to register entity definitions with a sax parser?
I want the following program to work without specifying an DTD in the
xml document.

from xml.sax import  handler, make_parser

class Parser(handler.ContentHandler):
    def startElement(self, name, attrs):
        print name, attrs['foobar']

doc = '''<?xml version="1.0"?>
<note bla="ä"></to>
</note> '''


Thanks for any help,
- Ralf

brainbot technologies ag
boppstrasse 64 . 55118 mainz . germany
fon +49 6131 211639-1 . fax +49 6131 211639-2  mailto:ralf at

More information about the Python-list mailing list