[XML-SIG] [Bug #130049] [4DOM] normalize() fails on DocumentFragments

noreply@sourceforge.net noreply@sourceforge.net
Thu, 25 Jan 2001 07:30:02 -0800


Bug #130049, was updated on 2001-Jan-25 07:30
Here is a current snapshot of the bug.

Project: Python/XML
Category: 4Suite
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: afayolle
Assigned to : nobody
Summary: [4DOM] normalize() fails on DocumentFragments

Details: I only tested this on 4Suite 0.10.0, please tell me if this was
fixed in 0.10.1.

Calling normalize() on a document fragment does not recurse to the child
elements (though it processes text nodes that are immediate childs of the
DF. Workaround is manually iterating through the child nodes of the DF and
calling normalize() manually.

Sample code:
from xml.dom.ext.reader import Sax2
d = Sax2.FromXml('<doc/>') # Yes, I know I'm a lazy boy...

df = d.createDocumentFragment()
df.appendChild(d.createElementNS('','foo'))
df.firstChild.appendChild(d.createTextNode('textNode1 '))
df.firstChild.appendChild(d.createTextNode('textNode2 '))

print 'before normalize'
print df.firstChild

df.normalize()

print 'after normalize'
print df.firstChild


For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=130049&group_id=6473