How to read a xml-file sequentially

Bill Tate tatebll at aol.com
Wed Oct 31 08:18:35 EST 2001


"Thomas Weholt" <thomas at gatsoft.no> wrote in message news:<BTwD7.8$Gm2.170776064 at news.telia.no>...
> Hi,
> 
> I need to read a xml-file sequentially, piece by piece, when a given end-tag
> to a given start-tag is found, the xml-data inbetween the start and end are
> sent to a different method for processing, then the next piece of data is
> read, sort of like old-school record-based files.
> 
> Only the needed data is kept in memory.
> 
> How can this be done using preferrably expat or sax? No DOM cuz the files
> are huge.
> 
> Thomas

Thomas -
Suggest you may also want to look at Pyxie.org site.  One of the tools
developed by Sean McGrath is a hybrid option.  The pyxie library
includes the capability of using event processing up to a particular
point (a specific start tag for example) and then switch over to
tree-like processing.  Sounds like it might be relevant for your
problem.  While Pyxie doesn't seem to have a lot of activity going on
with it right now, it does have a number of useful tools that work
well with the gymnastics of xml processing.



More information about the Python-list mailing list