CodeFileTreeNode.py
changeset 1100 1f46424c6220
parent 1096 c9ace6a881c9
child 1124 b1705000eba1
equal deleted inserted replaced
1099:d9c28879e55b 1100:1f46424c6220
    19             xmlfile = open(filepath, 'r')
    19             xmlfile = open(filepath, 'r')
    20             tree = minidom.parse(xmlfile)
    20             tree = minidom.parse(xmlfile)
    21             xmlfile.close()
    21             xmlfile.close()
    22             
    22             
    23             for child in tree.childNodes:
    23             for child in tree.childNodes:
    24                 if child.nodeType == tree.ELEMENT_NODE and child.nodeName == "CodeFile":
    24                 if child.nodeType == tree.ELEMENT_NODE and child.nodeName in ["CodeFile", "CFile"]:
    25                     self.CodeFile.loadXMLTree(child, ["xmlns", "xmlns:xsi", "xsi:schemaLocation"])
    25                     self.CodeFile.loadXMLTree(child, ["xmlns", "xmlns:xsi", "xsi:schemaLocation"])
    26                     self.CreateCodeFileBuffer(True)
    26                     self.CreateCodeFileBuffer(True)
    27         else:
    27         else:
    28             self.CreateCodeFileBuffer(False)
    28             self.CreateCodeFileBuffer(False)
    29             self.OnCTNSave()
    29             self.OnCTNSave()
    80         filepath = self.CodeFileName()
    80         filepath = self.CodeFileName()
    81         
    81         
    82         text = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
    82         text = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
    83         extras = {"xmlns":"http://www.w3.org/2001/XMLSchema",
    83         extras = {"xmlns":"http://www.w3.org/2001/XMLSchema",
    84                   "xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance",
    84                   "xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance",
    85                   "xsi:schemaLocation" : "codefile.xsd"}
    85                   "xsi:schemaLocation" : "code_file.xsd"}
    86         text += self.CodeFile.generateXMLText("CodeFile", 0, extras)
    86         text += self.CodeFile.generateXMLText("CodeFile", 0, extras)
    87 
    87 
    88         xmlfile = open(filepath,"w")
    88         xmlfile = open(filepath,"w")
    89         xmlfile.write(text.encode("utf-8"))
    89         xmlfile.write(text.encode("utf-8"))
    90         xmlfile.close()
    90         xmlfile.close()