Пример #1
0
    def parse(self,file_object):
        """Parse a file object."""
        t = et.parse(file_object)

        self.node = t.getroot()
        
        assemble(self,self.__class__)

        return self
Пример #2
0
    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__)
Пример #3
0
def from_string(xml_str):
    t = elemtree()
    return assemble(t,elemtree)
Пример #4
0
 def from_string(self,xml_str):
     """Parse a string."""
     self.node = xml.dom.minidom.parseString(xml_str).childNodes[0]
     
     return assemble(self,self.__class__)