[XML-SIG] minidom/pulldom connection

Fred L. Drake, Jr. fdrake@acm.org
Wed, 22 Nov 2000 15:37:52 -0500 (EST)

  In the standard library, there are two modules which deal with the
DOM:  xml.dom.minidom, which provides a collection of DOM classes, and
xml.dom.pulldom, which can actually build a DOM tree, and relies on
xml.dom.minidom to provide a the Document class.  Aside from one
reference to minidom.Document in PullDOM.startDocument(), there are no
references from pulldom to minidom.
  There is some concern that the minidom implementation does not
perform as many safety checks as it could; there is a competing
concern that adding the checks would cause it to be slow.  This seems
a perfect opportunity to support multiple DOM implementations; one
that's fast & light and another that's heavier but includes all the
safety checks.
  I'm proposing the attached patch to pulldom.  This modifies
PullDOM.__init__() to accept a Document object as a parameter, and
changes PullDOM.startDocument() to use that object or create a one
using minidom if necessary.  This allows all existing client code to
continue to work unchanged.
  Objections?  Comments?  Am I just being to weird about this?


Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Digital Creations