[XML-SIG] Documentation and problems

Simon Pepping spepping@scaprea.hobby.nl
Wed, 13 Jan 1999 20:05:43 +0100 (MET)

On 7 Jan 1999, Lars Marius Garshol wrote:

> I've now read through your document more thoroughly and have some
> corrections to it:
>  - the application should _not_ register the driver as a locator.
>    The drivers that provide location information do this themselves
>    before calling the startDocument method. Those that don't simply 
>    do not register a locator.
>    In fact, you have no guarantee that the parser and the locator are
>    the same object...

I had missed that, and I will modify my document as per your

Note, however, that drv_pyexpat.py does not register a locator, while,
if one registers the parser as the locator, it does implement the
locator methods (except for the fact that it does not report the
document, as noted before).

Do I understand correctly that the availability of a locator is not
guaranteed, so that the application should test for this?  Or should
every SAX parser provide at least dummy locator methods so that calls
to them do not generate errors, e.g. by inheriting from
saxlib.Locator? Then dvr_pyexpat.py should register the parser as the
locator. Currently it generates an attribute error if one tries to use
the locator methods.

>  - In <URL:http://www.hobby.nl/~scaprea/XML/t128.html> the last
>    paragraph repeats this.
>  - In <URL:http://www.hobby.nl/~scaprea/XML/t141.html> you write:
>    "A SAX application must contain the handler classes
>    DocumentHandler, DTDHandler, EntityResolver, and ErrorHandler,
>    which should implement the methods prescribed by the SAX
>    specification."
>    SAX applications don't have to implement any of these at all, and
>    in fact there exists an application that doesn't (saxtimer.py).
>    So the text should say 'can' instead of 'must'. (A nit, I know, but
>    one that would confuse literal-minded people like myself. :)

I mean to say that the application in principle should have such
methods, because the parser expects them and makes calls to them.. The
following paragraphs explain that these methods can be provided by
inheriting the dummy methods from the provided sax library.  I still
feel that I state this correctly.

I will follow your other suggestions. Thanks for your critical

Simon Pepping
email: spepping@scaprea.hobby.nl