def execute(self): # create an xml document xml_impl = getDOMImplementation() doc = xml_impl.createDocument(None, "session", None) root = doc.documentElement # go through the tactic tactic_nodes = self.util.get_all_tactic_nodes() tactic_nodes.sort() for tactic_node in tactic_nodes: node_data = NodeData(tactic_node) ref_node = node_data.get_ref_node() root.appendChild(ref_node) self.xml = doc.toxml() return self.xml
def introspect(my): '''introspect the session and create a session xml from it''' # create an xml document xml_impl = getDOMImplementation() my.doc = xml_impl.createDocument(None, "session", None) my.root = my.doc.documentElement # go through the tactic tactic_nodes = my.util.get_all_tactic_nodes() tactic_nodes.sort() for tactic_node in tactic_nodes: node_data = NodeData(tactic_node) ref_node = node_data.get_ref_node() # set some more info on the ref node ref_node.setAttribute("tactic_node", tactic_node) my.root.appendChild(ref_node) my.xml = my.doc.toprettyxml() return my.xml