added getparent()
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Tue, 15 Nov 2011 02:57:23 +0000 (21:57 -0500)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Tue, 15 Nov 2011 21:20:42 +0000 (16:20 -0500)
sfa/util/xml.py

index 3b19491..dece35b 100755 (executable)
@@ -61,6 +61,9 @@ class XmlNode:
         else:
             self.node.append(elem)
 
+    def getparent(self):
+        return XmlNode(self.node.getparent(), self.namespaces)
+
     def remove_elements(name):
         """
         Removes all occurences of an element from the tree. Start at