[XML-SIG] Re: Bug in expatreader module...

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sun, 17 Jun 2001 08:41:57 +0200


> This is a possible and valid answer, if you assume, that this type of
> programming does not make sense....

It's not a question whether this makes sense, but whether such
programming had been anticipated. As you can see, it clearly had not
been anticipated.

> http://python.sourceforge.net/devel-docs/lib/xmlreader-objects.html
> states:
> 
> setContentHandler(handler)
>       Set the current ContentHandler. If no ContentHandler is set, content
> events will be discarded.
>
> that means, that there are more than one content handler(i.e. the
> current one) so this documentation does not say, that I must not
> call setContentHandler again.

So that would be a documentation error. However, I just checked the
Java SAX documentation, at

http://www.megginson.com/SAX/Java/javadoc/org/xml/sax/XMLReader.html#setContentHandler(org.xml.sax.ContentHandler)

That says

# Applications may register a new or different handler in the middle
# of a parse, and the SAX parser must begin using the new handler
# immediately.

So I guess that your code ought to work, and that we should fix the
expatreader.

Regards,
Martin