[xml] copyNodeList eats all memory...



Hi,

I made a small Python program to duplicate specific branches
and put the copies somewhere in the tree.  For that I'm using
copyNodeList, something like:

    for curnode in somenodelist:
        newnode = curnode.copyNodeList()
        othernode.addNextSibling(newnode)

This works fine for a 1 MB XML document and the output seems to
be what I want, but with a 7 MB document it slows done pretty fast
and finally eats all memory, even on a 2 GB memory system!

Am I doing something wrong?  What is the recommended way of doing
a recursive copy of branches using libxml2?

Thanks,

--
--    Jos Vos <jos xos nl>
--    X/OS Experts in Open Systems BV   |   Phone: +31 20 6938364
--    Amsterdam, The Netherlands        |     Fax: +31 20 6948204



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]