[4suite] Releasing a document

Alexandre Fayolle alf at logilab.com
Mon Sep 4 11:59:14 MDT 2000


Hi there,

The product I'm currently working on (and that'll be released in 2-3
weeks) requires us to be able to release a document completely. By this I
mean releasing every node, even those that do not have a parent, but
are still attached to the document, like any well behaved Node.

To achieve this, we made a few changes to 4Dom, mainly adding a
dictionnary of nodes in Document and changing the constructor of Node so
that it adds the node to the dictionnary (we used a dictionnary because
lookup is much faster than in a list, but we basically use it as a
list). Then we added a ReleaseDocument function in xml.dom.ext that
Releases each Node in the dictionnary. It works fine... hmm, good enough
for now :o)

However, we are now facing a problem because our version of 4Dom is
getting different from 4Thought's. We considered changing the way we do
things by subclassing Node and Document to match our needs but in many
parts of 4Dom, there are direct calls to the constructor of a class
instead of a call to node.ownerDocument.createXXX(), and this is not
something we can deal with easily (it would mean rewriting these parts in
our subclasses...).

Hence the following questions :
* Would 4Thought integrate a ReleaseDocument patch in the official
release?
* Would 4Thought use a little bit of help to do some cleanup in order to 
respect the DOM interface internally with regard to Node creation ?
* Are those things fixed already and about to be released ?


-- 
Alexandre Fayolle
Logilab




More information about the 4suite mailing list