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

Martin von Loewis loewis at informatik.hu-berlin.de
Fri Mar 2 17:02:52 CET 2001


"Bruce Fleming" <bfleming at bserv.com> 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..?

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

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

Regards,
Martin




More information about the Python-list mailing list