[XML-SIG] Re: python SAX API

Alexandre Fayolle Alexandre.Fayolle@logilab.fr
Fri, 16 Nov 2001 15:13:24 +0100 (CET)


I'm fully aware that noone's going to dump xml.sax just because I express
some concerns about it. It's too late, and if I'm the only one expressing
concerns, the problem is probably on my side. I'll nevertheless express
these concerns, because I usually feel better afterwards. ;o)

On 16 Nov 2001, Lars Marius Garshol wrote:

> Well, I haven't had this experience. I was part of the Java SAX design
> process, and have used Java SAX for years now. I have no problems
> switching back and forth between the two. 

Well obviously, since you were part of the design process of both ;o)

> I think the problem here is your expectation that the two should be
> the same, not the design of Python SAX. And given the lack of Python
> SAX documentation I think your expectation is to some extent
> inevitable.

My general expectation is least surprise. Since SAX defines interfaces and
since it is fairly easy to translate the java interfaces of the reference
implementation into python, I'd expect the python version of these
interface to be close to the original. Furthermore, since python is much
nicer than Java, I'd expect the python version of SAX to provide a few
extensions to the API (for instance the attrs parameter of startElement to
be useable as a mapping object). But I do not expect the basic API to be
modified. In the case of a java-ism being used ib the original interface,
getting rid of it is OK (e.g. the characters() prototype is used because
using String objects in Java would be inefficient). 

It's the same for DOM, really. I expect a python DOM implementation to be
as close as possible to what is defined by the IDL description of the
interfaces. If it provides nice python extensions (direct access to the
attributes, NamedNodeMaps as python dictionnaries, all the better).

The main thing is: I want to learn the API once and be able to use it
naturally in all the languages I'm familiar with, after reading at most
half a page of documentation explaining the changes from the original API.
The mapping to the target language needs to be either very close to the
original spec, or very fine tuned to the language I'm using.

Now, that's it, I've finished ranting. I perfectly understand your point
of view, and I hope you understand my point. I'm not the boss here, and
I'll follow whatever decision has been taken before I arrived. 

I'll move on to productive suggestions, now that this has been sorted out.

Alexandre Fayolle
-- 
LOGILAB, Paris (France).
http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org
Narval, the first software agent available as free software (GPL).