[XML-SIG] Minidom bugs/questions

Mike Olson Mike.Olson@fourthought.com
Tue, 06 Feb 2001 17:56:34 -0700

"Martin v. Loewis" wrote:
> > I think we should also look at merging minidom and pDomlette.  Both are
> > supposed to be "mini" and I think they both support about the same sets
> > of functionality.  No sense keeping both of them around.  I can look at
> > the differences and try to merge them.
> I never quite understood where the "p" in pDomlette came from. To
> date, pDomlette is just 200 lines longer than minidom, so yes, merging
> them is a genuine option. Bear in mind that a new Python release is
> upcoming, and that the final beta release is probably the last point
> to add missing features (i.e. bug corrections with regard to DOM
> conformance). It is not inherently wrong to include a more complete
> version of minidom with PyXML, but it would be nice if it was stable
> after 2.1.

We've been using pDomlette pretty heavily for quite some time now.  It
is the default DOM in 4XSLT.  That would be one nice feature about
combining them both, the DOM that ships with Python 2.0 will work with
4XSLT (and 4XPath, 4XLink, et al).

> As for the differences, I wonder what to do with the
> auto-normalization feature of pDomlette. I can't figure out what
> exactly that means: auto-normalization during parsing, or
> auto-normalization during insertion of nodes. While I can see that it
> is useful, I'm concerned about standards compliance here.

It is during parsing.  If you append a text node after another text
node, it will keep them as two seperate nodes.  I think this is
standards compliant though iuf I recall the spec is a little bit hazy

> I feel some misunderstanding here. I'm talking about code like
>         if ownerDoc == None:
>             dt = implementation.createDocumentType('', '', '')
>             self._ownerDoc = implementation.createDocument('', None, dt)
>             self._rootNode = self._ownerDoc
> (from xml.dom.ext.reader.Sax), in particular about the invocation of
> createDocument with a null qualifiedName. I could not find any
> permission in the DOM spec for such usage, and Xerces/C++ has code like

Its for the readers.  If pass in a namespaceURI to createDocument it
will add the root element.  Then we would need special handeling code in
start_element to determine if a document element has been added, or if
it even has a document element.

Mike Olson				 Principal Consultant
mike.olson@fourthought.com               (303)583-9900 x 102
Fourthought, Inc.                         http://Fourthought.com 
Software-engineering, knowledge-management, XML, CORBA, Linux, Python