"""
Then we need something that allows parts of the XML file
to be written to file and purged from RAM to avoid the
memory problem.
Suggestions for solutions are appreciated.
"""
Multiple XML files is not an option, but what about general entities or
XInclude? That way you don't need to change
Magnus Lycka wrote:
> We're using DOM to create XML files that describes fairly
> complex calculations. The XML is structured as a big tree,
> where elements in the beginning have values that depend on
> other values further down in the tree. Imagine something
> like below, but much bigger and much
Gerard Flanagan wrote:
> what about multiple xml files?
We have deployed code that relies of the XML files
looking the way they do, and we'd prefer not to
change that.
--
http://mail.python.org/mailman/listinfo/python-list
Magnus Lycka wrote:
> We're using DOM to create XML files that describes fairly
> complex calculations. The XML is structured as a big tree,
> where elements in the beginning have values that depend on
> other values further down in the tree. Imagine something
> like below, but much bigger and muc
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
Ben Sizer wrote:
> output = []
>
> def write_tree(node):
> output.append("")
> sum = 0
> for child in reversed(node.children):
> if child.type = leaf:
> output.extend(["", "%d" % node.value, ""])
> sum += node.value
> else:
> sum += w
Fredrik Lundh wrote:
> what's the typical overall structure for this tree ? is it short and wide,
> or tall and
> narrow ?
That varies quite a bit. It's basically a call graph for a
functional language, where also aggregated results are stored
in the XML tree. In other words, the shape depends o
output = []
def write_tree(node):
output.append("")
sum = 0
for child in reversed(node.children):
if child.type = leaf:
output.extend(["", "%d" % node.value, ""])
sum += node.value
else:
sum += write_tree(node)
output.append("" %
Magnus Lycka wrote:
> We're using DOM to create XML files that describes fairly
> complex calculations. The XML is structured as a big tree,
> where elements in the beginning have values that depend on
> other values further down in the tree. Imagine something
> like below, but much bigger and muc
Magnus Lycka wrote:
>
>
>In some cases, building up a DOM tree in memory takes up
>several GB of RAM, which is a real showstopper. The actual
>file is maybe a magnitute smaller than the DOM tree. The
>app is using libxml2. It's actually written in C++. Some
>library that used much less memory over
We're using DOM to create XML files that describes fairly
complex calculations. The XML is structured as a big tree,
where elements in the beginning have values that depend on
other values further down in the tree. Imagine something
like below, but much bigger and much more complex:
11 matches
Mail list logo