This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author scoder
Recipients eli.bendersky, flox, jcea, ncoghlan, python-dev, scoder
Date 2013-08-25.10:04:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1377425082.52.0.10173275478.issue17741@psf.upfronthosting.co.za>
In-reply-to
Content
"""
1. Why have the "event builder" wrap a tree builder? Can't it just be a separate target?
"""

You need a TreeBuilder in order to build the tree for the events.

If you want to use a different target than a TreeBuilder, you're free to do so. That's the idea of wrapping.


"""
2. Instead of the stock XMLParser recognizing the event builder via isinstance and giving it special treatment, would it not be better to still have a separate class that implements the XMLParser interface (it can derive from it or just use duck typing)?
"""

Why would you want to restrict it to an XMLParser? If there was an HTMLParser (which exists in lxml.etree), then how would you make the two interact?

The isinstance() check was only a quick way to get the API working without changing the implementation in the back too much. The actual functionality should (eventually) be moved into the target itself. Currently, it is implemented internally in the parser inside of the C module. That's the main problem with the current implementation that needs fixing. See issue #17902 (which is not a documentation issue but a real issue, BTW).
History
Date User Action Args
2013-08-25 10:04:42scodersetrecipients: + scoder, jcea, ncoghlan, eli.bendersky, flox, python-dev
2013-08-25 10:04:42scodersetmessageid: <1377425082.52.0.10173275478.issue17741@psf.upfronthosting.co.za>
2013-08-25 10:04:42scoderlinkissue17741 messages
2013-08-25 10:04:41scodercreate