Stefan Behnel <stefan...@behnel.de> added the comment:

There are dedicated handler methods that you can implement: "def comment(self, 
comment)" and "def pi(self, target, data)". Both (c)ElementTree and lxml 
support those.

I think the "target" argument to the parser is a bit underdocumented, and the 
standard TreeBuilder does not implement those methods (because it does not use 
them).

https://docs.python.org/3/library/xml.etree.elementtree.html#xmlparser-objects

Probably worth mentioning that in the docs.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34600>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to