[XML-SIG] Uniform interface with Python 2.0

Paul Prescod paul@prescod.net
Thu, 14 Sep 2000 08:44:11 -0700

Lars Marius Garshol wrote:
> ...
> I think we should extend it so that the default parser list can be
> modified both from Python code and set via an environment variable
> (PY_SAX_PARSER?).  Other than that I think SAX 1.0 showed this
> approach to be very successful.

If you want to implement it i won't complain but I think that this
autoconfiguration stuff is overrated. The number 1 feature of SAX is
that I can change my mind and go from Expat to XMLProc in five minutes
rather than five hours. The number 2 feature is I can program for any
parser without reading parser-specific documentation. Dynamic parser
choice is low on the list of benefits, in my personal opinion. Plus, you
could always use Python's dynamic import features to implement your own
dynamic parser choice.

> It should probably appear as
> from xml import sax
> parser = sax.make_parser()

Agreed. And it probably wouldn't hurt to have an optional parser
argument to parse() and parseString()

 Paul Prescod - Not encumbered by corporate consensus
Simplicity does not precede complexity, but follows it. 
	- http://www.cs.yale.edu/homes/perlis-alan/quotes.html