[XML-SIG] SAX parser factories (Was: PyTRaX?)

Uche Ogbuji uche.ogbuji@fourthought.com
Wed, 18 Apr 2001 22:06:34 -0600


> > 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?

I like.  But I think we'll want more than just a parser factory:

properties = {"http://factory.pyxml.org/properties/encoding": "BIG5",
              "http://uche.ogbuji.net/my-extended-properties/spam": "eggs"}
features = ["http://factory.pyxml.org/properties/xpointer"]
xml.factory.getXsltProcessor(properties, features)


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python