Writing big XML files where beginning depends on end.
kylotan at gmail.com
Fri Nov 25 10:52:55 CET 2005
Magnus Lycka wrote:
> This won't help if we have problems keeping the whole
> structure / call graph in memory at one time.
Ah, I had assumed that the main problem was just that the resulting DOM
was too big. Still, I don't think there would be a problem if you just
constructed a very small tree and then wrote out XML based upon that,
instead of using an external library for this. For example, if your
only elements are node and leaf, you can store that distinction in 1
bit, as opposed to a library's naive implementation using the strings
"node" and "leaf", probably 40 bits in each case. Similarly you can
calculate the aggregate attributes on the fly when it comes to
outputting the tree instead of storing them.
More information about the Python-list