Re: [xml] redicting parts of trees


Replying to myself:

Martijn Faassen wrote:

But now I wonder: does this only apply to attribute nodes, or also to element nodes which are in a subtree? Testing this.. Ugh, yes, it does. When I move a namespaced element (where the namespace is defined higher in the tree) into another tree, and then subsequently remove the original tree, things go way wrong and valgrind indeed points to a reference to a libxml2 namespace structure that has since been removed. Not good...

But thanks for pointing this issue out to me!

I've since fixed this in lxml by employing xmlReconciliateNs. It'd be nicer if there was a proper adoptNode() functionality that took care of this as well (preferably in a single walk through the tree :), though I guess this problem also applies to nodes moving *within* trees..



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