コード例 #1
0
    def from_xml(self, xml_str):
        """
            Read in data from XML
            
            Helper class methods can be found in BaseScriptElement:

            @param xml_str: text to read the data from
        """
        self.reset()
        dom = xml.dom.minidom.parseString(xml_str)
        self.text = BaseScriptElement.getStringElement(dom, "example_content")
        self.alternate_text = BaseScriptElement.getStringElement(dom, "alternate_content")
コード例 #2
0
 def from_xml(self, xml_str):
     """
         Read in data from XML
         @param xml_str: text to read the data from
     """       
     dom = xml.dom.minidom.parseString(xml_str)
     element_list = dom.getElementsByTagName("%INSTR_NAME%ScriptElement")
     if len(element_list)>0: 
         script_dom = element_list[0]
         self.some_value = BaseScriptElement.getStringElement(script_dom, "some_value", default="my_favorite_wksp")