[lxml-dev] [Half-OT] libxml2 creates new python objects?
Hi, I know this is a bit OT, however the mailing list of libxml2 is rather quiet and so I'd like to ask here (if you think this is to OT, please just don't reply to my mail): Does anybody know wether libxml2 generates new python objects "on-the-fly"? I have a rather strange behaviour here where I get new objects any time I ask a node for it's children. At least thats the only way it can be. Let me explain a bit: I built a Qt4 model to represent a XML document, using the python bindings of libxml2 as implementation base. Now for lookup-speed I store all "already-seen" tree-items in a dictionary. But after opening the document root (html as root-element, 2 children) this dict already has 20 entries. Multiple times it contains a xml node for html. While "somehow" this still works for the model itself, it totally breaks the highlighting of nodes that match a given xpath expression. For that to work, I need to walk the already shown nodes (from the dictionary) and mark them for highlighting... I don't think there's another way to identify a node within a document, other than by the id I can obtain (or the reference to the object itself) - But if anybody has an idea for this, that would be great. If not, I'm probably filing a bugreport against libxml2's python bindings... Andreas -- Be free and open and breezy! Enjoy! Things won't get any better so get used to it.
On 20.06.06 00:00:05, Andreas Pakulat wrote:
I know this is a bit OT, however the mailing list of libxml2 is rather quiet and so I'd like to ask here (if you think this is to OT, please just don't reply to my mail):
Well I got a reply from libxml2 list (just in case anybody has any interest in this), it is intentional as they don't want to keep track of the references... I was also told that DOM Level 3 defines a function that tests for node equality, however I couldn't find anything in libxml2's API (neither Python nor C). If anybody has an idea about this I'd be glad to hear it... Andreas -- After your lover has gone you will still have PEANUT BUTTER!
participants (1)
-
Andreas Pakulat