elementtree: line numbers and iterparse

Stuart McGraw smcg4191zz at friizz.RimoovAllZZs.com
Wed Sep 13 02:38:20 EDT 2006


"Fredrik Lundh" <fredrik at pythonware.com> wrote in message news:mailman.1.1158124100.10491.python-list at python.org...
> Stuart McGraw wrote:
> > Now I find i need to get and save the input file line 
> > number of each node.  Googling turned up a way 
> > to do it by subclassing FancyTreeBuilder,
> > (http://groups.google.com/group/comp.lang.python/msg/45f5313409553b4b?hl=en&)
> > but that tries to read everything at once.
> > 
> > Is there a way to do something similiar with iterparse()?
> 
> something like this could work:
> ...snip...

Indeed it does.  Many thanks!




More information about the Python-list mailing list