]> git.sesse.net Git - xml-template/commitdiff
Fix the exceptions in the cloning. Still doesn't work, though.
authorsgunderson@bigfoot.com <>
Wed, 6 Sep 2006 15:37:56 +0000 (17:37 +0200)
committersgunderson@bigfoot.com <>
Wed, 6 Sep 2006 15:37:56 +0000 (17:37 +0200)
python/xmltemplate.py

index 4c1aa0d669a124198723041af8adf755ee33380e..cac93b717c4f3b35d97e1a647fc6a2b646d098ad 100644 (file)
@@ -52,10 +52,12 @@ def process(node, obj, clean = True):
 
                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:
@@ -64,7 +66,7 @@ def process(node, obj, clean = True):
                # 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)