Can SAX parser return <!-- COMMENTS --> ???

Piet van Oostrum piet at
Sun Mar 4 15:56:21 CET 2001

>>>>> Martin von Loewis <loewis at> (MvL) writes:

MvL> "Bruce Fleming" <bfleming at> writes:
>> How can I expose comments in the content handler ?
>> It does not return comments by default, and I cannot
>> find where to hook into the class..?

MvL> A ContentHandler never gets comments reported. That is what the
MvL> LexicalHandler is for (which is only defined in PyXML at the moment).

MvL> It is a matter of ongoing debate whether applications should even deal
MvL> with comments; if an application needs XML comments for proper
MvL> operation, something is wrong with that application.

What about a prettyprinter? Doesn't that count as an application?
Piet van Oostrum <piet at>
Private email: P.van.Oostrum at

More information about the Python-list mailing list