[lxml-dev] iterparse - finally :)
Hi all, I finally decided to take a shot at iterparse() and it turned out to be a matter of hours to implement it. It's very similar to ET's implementation and builds on top of the SAX2 interface of the libxml2 parser (as I proposed in my last post on this topic). It is currently implemented on the iterparse branch: https://codespeak.net/svn/lxml/branch/iterparse/ https://codespeak.net/viewvc/lxml/branch/iterparse/ It passes ET's selftest.py and a few other test cases (including clear()ing up in the end). Anyone out there who has iterparse() code available is invited to run it against the new implementation. If it works better than I currently expect :), it will become part of the lxml 1.1 feature set. Stefan
Stefan Behnel a écrit :
Hi all,
I finally decided to take a shot at iterparse() and it turned out to be a matter of hours to implement it. It's very similar to ET's implementation and builds on top of the SAX2 interface of the libxml2 parser (as I proposed in my last post on this topic).
It is currently implemented on the iterparse branch:
https://codespeak.net/svn/lxml/branch/iterparse/ https://codespeak.net/viewvc/lxml/branch/iterparse/
Great! Cannot wait to try it on my projects! Thank you very much for your hard work on lxml :) -- Olivier
Hi again, Stefan Behnel wrote:
I finally decided to take a shot at iterparse() and it turned out to be a matter of hours to implement it. It's very similar to ET's implementation and builds on top of the SAX2 interface of the libxml2 parser.
I also added a small extension to iterparse: the 'tag' keyword argument. It works as in element.getiterator(tag) and restricts the start/end events to the named tag. The start-ns and end-ns events are not impacted. This is mainly a convenience extension for cases where all interesting data is stored below a certain element type. Stefan
participants (2)
-
Olivier Grisel
-
Stefan Behnel