[XML-SIG] Re: [4suite] ReleaseNode interface in 4XSLT

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sun, 13 May 2001 16:41:25 +0200

[yes, I indeed meant to cross-post to xml-sig]

> Wouldn't it be better to make up a Reader class for minidom which
> implements a releaseNode method similar to what you have above?  The
> idea behind the reader architecture is to manage such things.

How would that work? Assume there was a reader class for minidom, and
the XSLT runtime had a node object. How can you release the node?

Or do you need to know the reader class which originally created that
node as well? That would be not so good: the node might not have been
created by a reader at all, as it might have come directly from the
DOM implementation.

> There might be some places in 4XSLT that don't properly call releaseNode
> on the reader instance itself, but I'd rather fix them to do so.

There is a number of those. Grepping for ReleaseNode in the public CVS

Processor.py:            pDomlette.ReleaseNode(rtfRoot)
Processor.py:            xml.dom.ext.ReleaseNode(rtfRoot)
Processor.py:            pDomlette.ReleaseNode(self._dummyDoc)
Stylesheet.py:            pDomlette.ReleaseNode(imp.stylesheet.ownerDocument)
StylesheetReader.py:        pDomlette.ReleaseNode(inc)
StylesheetReader.py:        pDomlette.ReleaseNode(sheet.ownerDocument)
StylesheetReader.py:                pDomlette.ReleaseNode(inc)
XsltContext.py:            pDomlette.ReleaseNode(doc)
XsltContext.py:                    pDomlette.ReleaseNode(rtf)
XsltContext.py:                    xml.dom.ext.ReleaseNode(rtf)

> What's "minisupport" and "_XsltElementBase"?

minisupport is an emulation of pDomlette equivalents as used by 4XSLT,
implemented using pDomlette. There are various pieces that I found
necessary: readers, ReaderBase, and Element. The latter is there to
support pickling, and to support the __init__ signature expected from

> Maybe we need a general Reader class for unknown DOM classes.  This
> would require the unification of DOM factories we were discusing a few
> months ago, but the releaseNode method could just be a NOP, i.e. your
> (c) option.

I don't recall that discussion. Your comment seems to imply a
relationship between a DOM implementation and a Reader class, which I
can't find in the 4Suite code. What do I miss?