Merge branch 'master' of ssh://git.planet-lab.org/git/sfa
[sfa.git] / sfa / util / xml.py
index 047c997..47de319 100755 (executable)
@@ -40,8 +40,10 @@ class XpathFilter:
 class XmlNode:
     def __init__(self, node, namespaces):
         self.node = node
+        self.text = node.text
         self.namespaces = namespaces
         self.attrib = node.attrib
+        
 
     def xpath(self, xpath, namespaces=None):
         if not namespaces:
@@ -66,6 +68,9 @@ class XmlNode:
             parent = element.getparent()
             parent.remove(element)
 
+    def remove(element):
+        self.node.remove(element)
+
     def set(self, key, value):
         self.node.set(key, value)
     
@@ -95,7 +100,7 @@ class XML:
             self.parse_xml(xml)
         if isinstance(xml, XmlNode):
             self.root = xml
-            self.namespces = xml.namespaces
+            self.namespaces = xml.namespaces
         elif isinstance(xml, etree._ElementTree) or isinstance(xml, etree._Element):
             self.parse_xml(etree.tostring(xml))