[Patches] [Patch #102477] DOM enhancements
noreply@sourceforge.net
noreply@sourceforge.net
Sun, 3 Dec 2000 03:32:18 -0800
Patch #102477 has been updated.
Project: python
Category: XML
Status: Open
Submitted by: fdrake
Assigned to : loewis
Summary: DOM enhancements
Follow-Ups:
Date: 2000-Nov-22 13:39
By: fdrake
Comment:
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, while supporting use of alternate DOM implementations.
-------------------------------------------------------
Date: 2000-Nov-22 22:24
By: fdrake
Comment:
Revised patch based on Greg Stein's note that the original would not create a new Document instance for each call to startDocument(); this version takes a document factory instead of a document object, and creates a new document with each call to startDocument().
-------------------------------------------------------
Date: 2000-Nov-27 13:38
By: gvanrossum
Comment:
Fred, please pick someone to review this and assign it to them.
-------------------------------------------------------
Date: 2000-Nov-27 15:03
By: fdrake
Comment:
[Changed summary line to reflect updated patch. Assigning to Martin since he cares about this stuff. ;-) ]
xml.dom.minidom changes:
This improves the Node.normalize() method based on Martin's suggestions, but does not address all of his concerns (re-linking siblings in particular). Test suite is updated to test that empty Text nodes are removed.
Minor improvement to an AttributeError that should not normally ever be seen by users.
Adds minimal support for DocumentType and DOMImplementation.
Partially fixes problem that documentElement was not properly supporting remove/replace; this should make it a little better, but sacrifices performance of using .documentElement to get it; the performance loss can be corrected by extending more methods in the Document class and removing the dynamic lookup of the documentElement attribute.
xml.dom.pulldom changes:
The PullDOM class now uses a DOMImplementation for the documentFactory object. It's not clear that the createDocument method is used correctly, but the DOM Level 2 documentation for DOMImplementation is seriously lacking.
-------------------------------------------------------
Date: 2000-Nov-29 07:13
By: fdrake
Comment:
Uploading fixed patch, since something appearantly went wrong with the last upload.
Removed attempted use of cStringIO; that doesn't work with Unicode that can't be encoded using the default encoding for strings (often 7-bit ASCII), so we always use the original StringIO module.
-------------------------------------------------------
Date: 2000-Dec-03 03:32
By: loewis
Comment:
Comments in patch order:
- AttributeError: Is it better style to write AttributeError(key)?
- normalize: If the first text node is empty, I believe it won't be removed (unless the next node is also a text node)
- Doctype.unlink is unnecessary; that is handled in Node (in general, each
unlink should handle only the attributes introduced in this inheritance level)
- hasFeature: I think we cannot claim conformance to "xml" yet; that would require
CDATASection, Notation, Entity, EntityReference and ProcessingInstruction support.
- Document: Shouldn't implementation point to the DOMImplementation instance that created the Document?
-------------------------------------------------------
-------------------------------------------------------
For more info, visit:
http://sourceforge.net/patch/?func=detailpatch&patch_id=102477&group_id=5470