[XML-SIG] Re: python SAX API
Lars Marius Garshol
larsga@garshol.priv.no
16 Nov 2001 17:11:04 +0100
* Lars Marius Garshol
|
| Well, there's nothing anyone can do about that. You're here now, and
| you have this concern, so let's thrash it out and see what we can do
| about it. It's the wrong time to change the API, but there must be
| other things we can do.
* Juergen Hermann
|
| There are two things we can do:
|
| 1. CLEARLY document what is Python SAX and what is different in PSAX
| to JSAX.
I agree. This is one of the things I listed in my task list.
| 2. Describe a way to dynamically adapt to the mess, and have driver
| authors implement that.
What mess? Please be specific.
| Regarding 2.: It's possible to hasattr(contenthandler,
| 'startElement') and we should use that; i.e. if the handler does not
| fit to our feature setting, adapt to the handler.
|
| This can be further improved by remembering whether someone changed
| our default feature setting, and only adapt in the default
| case. Else, a MEANINGFUL exception is raised (i.e. not "startElement
| was called with 3 args ... bleh", but "you set feature namespaces to
| true, and your handler does not reflect that").
We should be very careful not to try to be too smart here; that
generally leads to much more subtle problems. Can you explain in
detail what you think the problem is (because I don't know that there
is one)? Once you've done that we can try to find some solution.
--Lars M.