[XML-SIG] Request For Clarification on packages

Lars Marius Garshol larsga@garshol.priv.no
19 Jul 2001 12:11:15 +0200


* Alexandre Fayolle
| 
|  * xml.sax.drivers contains SAX wrappers for the 4 parsers above, plus
| wrappers for some other parsers

Yep. These are SAX 1.0 and obsolete.
 
|  * xml.sax.drivers2 contains SAX 2.0 wrappers for pyxexpat and xmlproc

Yep.
 
|  * xml.sax.expatreader really belongs to xml.sax.drivers2 but is there for
| backwards compatibility. One should preferably use
| xml.sax.drivers2.drv_pyexpat

This file is empty and uses xml.sax.expatreader. I think this was done
to make interoperation with the main Python distro easier. drv_pyexpat
could really go away.
 
|  * a SAX 2.0 parser should implement the interface defined in
| xml.sax.xmlreader.XmlReader

Yes. If possible, it should also implement IncrementalParser. That is,
if the underlying parser provides the necessary functionality.
 
|  * xml.sax.handler defines the interface that should be implemented by
| someone willing to use a SAX2.0 parser. A parser making callback to
| methods not defined in there is not SAX 2.0 compatible.

True. Parsers can have properties that are callback handlers, however,
and this is the right way to sneak in new callbacks.
 
|  * xml.sax.saxlib defines the interfaces of objects manipulated by a SAX
| 2.0 parser.

Yes. 
 
|  * xml.sax.saxutils provides basic implementations of some of the
| interfaces defined in handler and saxlib

Yes.

|  * xml.dom.ext.reader.Sax contains a DOM generator that uses a SAX parser,
| with the Reader interface

SAX 1.0, yes, and therefore obsolete.
 
|  * xml.dom.ext.reader.Sax2 contains a DOM generator that uses a SAX 2.0
| parser with the Reader interface

Yes.
 
|  * xml.dom.ext.reader.HtmlSax is an HTML DOM generator which uses a SAX
| parser as the input (is this SAX 1 or SAX 2?)

This is SAX 1.0, but turning it into SAX 2.0 should be trivial. Only
ignorableWhitespace() and characters() need to be changed.
 
|  * xml.dom.ext.reader.PyExpat is a DOM generator that uses the raw
| Expat reader together with the Reader interface

Yes.
 
|  * xml.dom.ext.reader.Sax2Lib is redundant with xml.sax.handler

Yes. Some of it is also incompatible, it seems. This should be
deleted, IMHO.
 
--Lars M.