[XML-SIG] Re: [ Pythonlabs ] UUNET DSL Installation (the new saga)

Fred L. Drake, Jr. fdrake@acm.org
Sun, 17 Jun 2001 02:12:50 -0400 (EDT)


Martin v. Loewis writes:
 > The bug is in your code, not in the expatreader. After parsing has
 > started, you must not call setContentHandler anymore. The behaviour is
 > undefined if you do.

Achim Gaedke writes:
 > 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.

  If we look at the Java SAX2 API documentation at www.megginson.com,
it specifically allows handlers to be changed at any time; the new
handler should replace the old one and the change should take place
immediately.  I think I should clarify the Python SAX documentation
to correspond with the intended behavior of SAX2, and any
implementation that does not conform to that expectation should be
fixed so that it does.
  If there are no objections from the SIG, I'll make the documentation
change this week, and try to squeeze in a test case for the SAX in the
standard Python library.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Digital Creations