for child in node.childNodes:
frag.appendChild(child)
+
+ for child in node.childNodes:
node.removeChild(child)
for instance in obj:
- newnode = frag.clone(True)
+ newnode = frag.cloneNode(True)
node.appendChild(newnode)
process(newnode, instance, clean)
if clean:
# remove all the <fragment> tags
for child in node.childNodes:
- if child.name == 'temporary-fragment':
+ if isinstance(child, xml.dom.minidom.Element) and child.tagName == 'temporary-fragment':
for child2 in child.childNodes:
node.appendChild(child2)
node.removeChild(child)