Passing data out of a Sax parser
tim at remove_if_not_spam.digitig.co.uk
Sat Sep 20 01:54:09 CEST 2003
Is there a preferred way of passing data out of a Sax parser? My Sax
content handler constructa an object for the rest of the program to
use, but I'm not sure how to pass it to the rest of the program. Ways
I can see:
a. Put it in a global (blech!)
b. Add a parameter to the handler's __init__ method, that takes some
sort of mutable object, and put the answer into that object.
Is it one of these that I should do? I suppose I could pass in the
owning parser, and put the result into a new member of the parser, but
I wonder if I'm missing something.
More information about the Python-list