Commit 05a19a50 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

#1433694: minidom's .normalize() failed to set .nextSibling for last element.

Fix by Malte Helmert
parent be0adfcf
......@@ -806,6 +806,14 @@ def testNormalize():
"testNormalize -- single empty node removed")
doc.unlink()
def testBug1433694():
doc = parseString("<o><i/>t</o>")
node = doc.documentElement
node.childNodes[1].nodeValue = ""
node.normalize()
confirm(node.childNodes[-1].nextSibling == None,
"Final child's .nextSibling should be None")
def testSiblings():
doc = parseString("<doc><?pi?>text?<elm/></doc>")
root = doc.documentElement
......
......@@ -203,6 +203,8 @@ class Node(xml.dom.Node):
L.append(child)
if child.nodeType == Node.ELEMENT_NODE:
child.normalize()
if L:
L[-1].nextSibling = None
self.childNodes[:] = L
def cloneNode(self, deep):
......
......@@ -266,6 +266,7 @@ Shane Hathaway
Rycharde Hawkes
Jochen Hayek
Thomas Heller
Malte Helmert
Lance Finn Helsten
Jonathan Hendry
James Henstridge
......
......@@ -15,6 +15,10 @@ Core and builtins
Library
-------
- Bug #1433694: minidom's .normalize() failed to set .nextSibling for
last child element.
Extension Modules
-----------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment