[XML-SIG] Error using xml.sax.{xmlreader,expatreader}

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Tue, 28 Nov 2000 08:02:49 +0100

> The XML HOWTO was apparently written for SAX1;

Can you please point to a specific sentence or paragraph in
http://www.python.org/doc/howto/xml/ that gave you that impression?

> I had to guess several method names from the source now that
> parseFile and setDocumentHandler don't exist

In the source of xml/doc/xml-howto.tex, I can't find a single
mentioning of setDocumentHandler.

> The Builder class was dropped from DOM for no reason I could find,
> and the only other XML writer, xml.sax.saxutils.XMLGenerator, is
> undocumented.

Apparently, you've been looking at an old version of the HOWTO. Where
did you find that version?

> Are there plans to document XMLGenerator?  

Please have a look at


and let me know which specific information did you expect to see that
isn't there.

> I was going to use it, but I would have to subclass it for comments
> and indentation, so I just decided to write the tags out myself.
> One reason I used DOM instead of SAX for a previous project was
> because DOM supported both reading and writing (via Builder),
> whereas SAX (seemingly) supported only reading XML.

Indentation is a hard problem: Adding whitespace may modify the
meaning of the document, depending on the
DTD. xml.sax.writer.PrettyPrinter does indentation; this is a SAX1
DocumentHandler, though.