Commit Graph

14 Commits

Author SHA1 Message Date
Fred Drake 4ccf4a1e8a Reduce the visibility of imported modules for cleaner "from ... import *"
behavior.

Added support for the Attr.ownerElement attribute.

Everywhere:  Define constant object attributes in the classes rather than
on the instances during object construction.  This reduces the amount of
work needed for object construction and destruction; these need to be
lightweight operations on a DOM.

Node._get_firstChild(),
Node._get_lastChild():  Return None if there are no children (required for
        compliance with DOM level 1).

Node.insertBefore():  If refChild is None, append the new node instead of
        failing (required for compliance).  Also, update the sibling
        relationships.  Return the inserted node (required for compliance).

Node.appendChild():  Update the parent of the appended node.

Node.replaceChild():  Actually replace the old child!  Update the parent
        and sibling relationships of both the old and new children.  Return
        the replaced child (required for compliance).

Node.normalize():  Implemented the normalize() method.  Required for
        compliance, but missing from the release.  Useful for joining
        adjacent Text nodes into a single node for easier processing.

Node.cloneNode():  Actually make this work.  Don't let the new node share
        the instance __dict__ with the original.  Do proper recursion if
        doing a "deep" clone.  Move the attribute cloning out of the base
        class, since only Element is supposed to have attributes.

Node.unlink():  Simplify handling of child nodes for efficiency, and
        remove the attribute handling since only Element nodes support
        attributes.

Attr.cloneNode():  Extend this to clear the ownerElement attribute in
        the clone.

AttributeList.items(),
AttributeList.itemsNS():  Slight performance improvement (avoid lambda).

Element.cloneNode():  Extend Node.cloneNode() with support for the
        attributes.  Clone the Attr objects after creating the underlying
        clone.

Element.unlink():  Clean out the attributes here instead of in the base
        class, since this is the only class that will have them.

Element.toxml():  Adjust to create only one AttributeList instance; minor
        efficiency improvement.

_nssplit():  No need to re-import string.

Document.__init__():  No longer needed once constant attributes are
        initialized in the class itself.

Document.createElementNS(),
Document.createAttributeNS():  Use the defined constructors rather than
        directly access the classes.

_get_StringIO():  New function.  Create an output StringIO using the most
        efficient available flavor.

parse(),
parseString():  Import pulldom here instead of in the public namespace of
        the module.
2000-11-21 22:02:22 +00:00
Fred Drake 16f6329e61 Make reindent.py happy (lots of trailing whitespace removed). 2000-10-23 18:09:50 +00:00
Paul Prescod 4221ff0ee1 Clear siblings, now that they are being set. 2000-10-13 20:11:42 +00:00
Fred Drake 13a3069c2b Paul Prescod <paul@prescod.net>:
Correct the chaining between siblings.
2000-10-09 20:04:16 +00:00
Martin v. Löwis 830b37bd74 Don't use string methods to allow sharing this code with PyXML. 2000-10-07 19:03:20 +00:00
Martin v. Löwis a2fda0dfab Record bugs found when comparing the module with DOM Core Level 2. 2000-10-07 12:10:28 +00:00
Martin v. Löwis 2c8a89cc3f minidom: access attribute value before printing it
correct order of constructor args in createAttributeNS
pulldom: use symbolic names for uri and localnames
         correct usage of createAttribute and setAttributeNode signatures.
2000-10-06 22:36:03 +00:00
Fred Drake 1f54902e05 Conform to the Python style guide. 2000-09-24 05:21:58 +00:00
Paul Prescod ce88db0230 Fixed bug that disallowed processing instructions before and after
document element.
2000-09-15 17:09:19 +00:00
Paul Prescod 623511b7df Added a few docstrings 2000-07-21 22:05:49 +00:00
Paul Prescod 6c4753f925 Used original SAX handling form. 2000-07-04 03:39:33 +00:00
Paul Prescod 1e68827c8f Misc fixes and improvements. 2000-07-01 19:21:47 +00:00
Paul Prescod 73678dac48 Reference cycle fixes 2000-07-01 04:58:47 +00:00
Fred Drake 55c3819e6a Paul Prescod <paul@prescod.net>:
W3C DOM implementation for Python.
2000-06-29 19:39:57 +00:00