[XML-SIG] SAX parser factories (Was: PyTRaX?)
Martin v. Loewis
martin@loewis.home.cs.tu-berlin.de
Wed, 18 Apr 2001 21:42:09 +0200
> Good point. There does need to be something along the lines of the
> make_parser function in SAX.
My proposal would be to add two keyword arguments, properties= and
features=. Each is a list of binary tuples, each tuple has name and
value. Alternatively, dictionaries might be better.
make_parser will the iterate over all known parser factories, invoking
create_parser for each, then trying to set all the properties and
features. It will return the first parser that supports all of them,
and return a configured instance.
There should also be a function xml.sax.register_parser, which accepts
an object that has a create_parser function, or a string naming a
module that has a create_parser function.
What do you think?
Regards,
Martin