"drop-in" DOM replacement for minidom?

Harry George harry.g.george at boeing.com
Wed Aug 13 18:55:19 CEST 2003


Paul Miller <paul at fxtech.com> writes:

> We've run into minidom's inabilty to handle large (20+MB) XML files, and
> need a replacement that can handle it. Unfortunately, we're pretty
> dependent on a DOM, so a pulldom or SAX replacement is likely out of the
> question for now.
> 
> Has someone done a more efficient minidom replacement module that we can
> just drop in? Preferrably written in C?
> 
> 

We had a similarly large file, and could not handle it in DOM.  It was
not a minidom issue.  Rather it was the fact that DOM in general takes
a lot of memory and that was putting us into swapping.  Switching to
SAX was a major improvement in mem usage and thus in parse time.

Our architecture made moving from DOM to SAX pretty straightforward.
We use XML to build our own "neutral representation" of Python
classes, and then traverse that for our applications.  This is instead
of hardcoding DOM (or SAX) calls throughout the applications.  If you
have the hardcoding approach, you may want to look at the neutral rep
approach -- it pays off in many ways.

-- 
harry.g.george at boeing.com
6-6M31 Knowledge Management
Phone: (425) 342-5601




More information about the Python-list mailing list