busting-out XML sections

Andrew Kuchling akuchlin at mems-exchange.org
Mon Oct 9 10:23:14 EDT 2000


"Alex Martelli" <aleaxit at yahoo.com> writes:
> An XML DOM implementation doesn't *have* to build a whole tree in memory: it
> *may*, but a clever implementation might well choose to use another strategy
> when it discovers the incoming XML file is really huge.  E.g., if the XML
> file is

The ZODB might also offer a way to do this -- make Node subclass
ZODB's Persistent base class, and build the DOM tree in the usual way.
The ZODB's automatic persistence and caching would then take care of
swapping in nodes as they're required.  As a bonus, you'd get the
ZODB's support for transactions.

(The tricky part is changing 4DOM so that it will work whether or not
the ZODB package is installed.  This means that whether or not Node
inherits from Persistent would have to be made conditional, which
requires some simple but slightly icky fiddling about with __bases__.)
 
--amk




More information about the Python-list mailing list