Lines Matching refs:self
85 def __init__(self, xmlfile, outPath): argument
86 self.doc = xml.dom.minidom.parse(xmlfile)
87 self.root = self.doc.documentElement
88 self.out = os.path.join(outPath, "xml")
89 if not os.path.isdir(self.out):
90 os.makedirs(self.out)
93 def split(self, tag): argument
95 elemlist = self.doc.getElementsByTagName(tag)
98 elem = self.__trimElem(elem)
99 self.__generateFile(elem)
103 def __trimElem(self, elem): argument
115 child = self.__trimElem(child)
120 def __generateFile(self, elem): argument
121 self.__removeAllChild(self.root)
123 … filename = os.path.join(self.out, elem.getAttribute("name").replace(".", "_").lower() + ".xml")
126 doc.appendChild(self.root)
128 self.root.appendChild(elem)
136 def __removeAllChild(self, elem): argument