XML DOM, but in chunks



I have some very large XML files that are basically recordsets. I
would like to access each record, one-at-a-time, and I particularly
like the ElementTree library for accessing the data. Is there a way
to have ElementTree read only one record of the data at a time?
Alternatively, are there other ways that would allow one to parse out
a record at a time and maintain some nice ways of accessing the
elements within the record?

Thanks,
Sean

.



Relevant Pages

  • elementtree and rounding questions
    ... I just started using the elementtree module yesterday to work ... I'm hoping someone might tell me if the first example of code above is a decent way to parse xml files. ... One other question I had was about rounding floats. ... Does anyone have a preference of how they like to round as well as the result they see? ...
    (comp.lang.python)
  • ElementTree and proper identation?
    ... I've been doing a little studying of ElementTree and it doesn't seem very satisfactory for writing XML files that are properly formatted/indented. ... I saw on the website that there is an indent/prettyprint function, but this isn't listed in the Python docs and I didn't see it after doing a dir, so I guess it isn't a part of the Python version. ...
    (comp.lang.python)
  • Re: Parse xml file
    ... ElementTree is available as an external package for Py2.4 (and it's in the ... It's pretty much the easiest way to get data out of XML files. ... very memory efficient, so you might still get away with just reading the ...
    (comp.lang.python)
  • Re: ElementTree and proper identation?
    ... I saw on the website that there is an indent/prettyprint function, but this isn't listed in the Python docs and I didn't see it after doing a dir, so I guess it isn't a part of the Python version. ... Did I miss something somewhere else, or can you just not use ElementTree to write formatted XML files as they'd look if done by hand? ... I would assume you can't just use ElementTree to write them to a file, but perhaps there is a different way to write to a file that still uses the Element objects? ...
    (comp.lang.python)
  • Re: XML DOM, but in chunks
    ... would like to access each record, one-at-a-time, and I particularly ... to have ElementTree read only one record of the data at a time? ... You need a Python implementation of the SAX API ... I think iterparse() is what he was looking for. ...
    (comp.lang.python)