Patches item #1621421, was opened at 2006-12-23 15:01
Message generated for change (Comment added) made by jorend
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1621421&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: XML
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Paul Pacheco (paulpach)
Assigned to: Nobody/Anonymous (nobody)
Summary: normalize namespace from minidom

Initial Comment:
This is a patch that fixes bug 1371937, along with a test case that reproduces 
the original problem.

The patch is a port of the algorithm described here pretty much verbatim:
http://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#normalizeDocumentAlgo

to resolve namespace declarations. The patch also calls the normalizeNamespace 
method before calling writexml

Note the patch is against minidom that comes with python 2.5, NOT WITH PYXML. I 
need this for an embedded project where pyxml is too big.



----------------------------------------------------------------------

Comment By: Jason Orendorff (jorend)
Date: 2007-03-14 23:03

Message:
Logged In: YES 
user_id=18139
Originator: NO

Thanks for the patch.

I think this is probably *not* desirable in this form.  As a side effect
of writexml(), this fixes up tagNames and attributes of elements in the
document.  DOM Level 3 Load and Save made the opposite decision:  "The XML
data is written to a string or an output stream. Any changes or fixups made
during the serialization affect only the serialized data. The Document
object and its children are never altered by the serialization operation." 
--
http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer
(first paragraph)  I think that is the right approach.

The new method Element.normalizeNamespace() isn't really a DOM method,
though the appendix sort of makes it look that way.

Incomplete - no doc patch.  (I think there's also a bug in the line added
to Document.writexml()-- can't Documents have children that aren't
Elements?)


----------------------------------------------------------------------

Comment By: Paul Pacheco (paulpach)
Date: 2006-12-24 10:32

Message:
Logged In: YES 
user_id=794762
Originator: YES

File Added: test_toxml.py

----------------------------------------------------------------------

Comment By: Paul Pacheco (paulpach)
Date: 2006-12-24 10:29

Message:
Logged In: YES 
user_id=794762
Originator: YES

File Added: normalizeNamespace.diff

----------------------------------------------------------------------

Comment By: Paul Pacheco (paulpach)
Date: 2006-12-23 15:02

Message:
Logged In: YES 
user_id=794762
Originator: YES

File Added: normalizeNamespace.diff

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1621421&group_id=5470
_______________________________________________
Patches mailing list
Patches@python.org
http://mail.python.org/mailman/listinfo/patches

Reply via email to