def endElement(self, name):
    print('EndElement: %s' % name)

def characters(self, ch):
    pass
parser = xml.sax.make_parser()
parser.setContentHandler(MyHandler())
for line in open('text.xml', 'r'):
    parser.feed(line)
Setting the encoding for sax parser in Python