def parse(self,file_object): """Parse a file object.""" t = et.parse(file_object) self.node = t.getroot() assemble(self,self.__class__) return self
def parse(self,file_object): """Parse a file object.""" #parse it self.node = xml.dom.minidom.parse(file_object).childNodes[0] return assemble(self,self.__class__)
def from_string(xml_str): t = elemtree() return assemble(t,elemtree)
def from_string(self,xml_str): """Parse a string.""" self.node = xml.dom.minidom.parseString(xml_str).childNodes[0] return assemble(self,self.__class__)