[XML-SIG] minidom changes

Mike Olson Mike.Olson@fourthought.com
24 Jul 2002 16:38:25 -0600


I'm going to check in my minidom changes so that 0.8 mostly works with
XPath and Xslt (I'll explain more latter).  I have a question first. 
When does the version string in xml get updated, at the time of the
release?  Is there a chance that we can get it changed now.  If not
there will be problems with people using CVS versions of both PyXML and
4Suite as the version of xml is the only key I have on what fixups to
make.

Here is a list of changes that I'll be checking in.  Most are pretty
minor interface additions.

*  Added childNodes to Attr.  It was there but always empty, now all
Attrs will have one child Text node with the nodeValue

*  Added empty localName and prefix on all nodes.

*  Added a specified attribute to Attrs.

*  modified createDocument on DOMImplementation.  Dom Level III states
that if the namespace, qname and doctype are Null then the document is
created without a document element.  Also removed the creation of a
default doctype if the parameter is None as Dom also states that a Null
doctype is valid.  This is probably the most contriversial of all of my
changes.

*  modifed the __setattr__ on Character data to update both the
nodeValue and data when modified.

*  Changed ownerDoc to ownerDocument in createDocumentFragment

*  Changed so Comment inherits from CharacterData

*  Modified __setattr__ on processing Instruction to allow mutation of
target.

*  Rewrote cloneNode.  The cloneNode that was there only worked with
nodes that were python instances (not cDomlette).  The rewrite is one
that I had for pDomlette so I just ported it over.  It is also designed
to work for importNode as well (hence the need for cloning cDomlette).  

*  Added importNode to document.  

*  Changed EmptyNodeList to return a list not a tuple.  I kinda
understand why this returned a tuple (speed, no mutation), but it breaks
code in Xslt because you cannot do [] + () which we do a fair amount.


There are four changes I did not add to minidom that are still in our
abstraction module.  I can add them if everyone thinks they are
acceptable.

1.  allow a data argument to the constructor of Text.
2.  Dictionary interface on ReadOnlySequentialNamedNodeMap
3.  module level implementation variable.
4.  Changed all of the dictionary access methods on NamedNodeMap to
access the NS values.  Example, currently, keys() access self.__attrs
and keysNS() access self._attrsNS.  Since 4Suite is NS only, all of our
code calls keys() and expects to get back the NS attributes.


Checking in now.

Mike




-- 
Mike Olson                                Principal Consultant
mike.olson@fourthought.com                +1 303 583 9900 x 102
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St,                      http://4Suite.org
Boulder, CO 80301-2537, USA
XML strategy, XML tools, knowledge management