PLCControler.py
changeset 500 b3499ff87178
parent 491 d22a4a95fd5e
child 507 42150e041dbe
--- a/PLCControler.py	Mon May 10 21:36:11 2010 +0200
+++ b/PLCControler.py	Wed May 19 22:16:29 2010 +0200
@@ -2562,7 +2562,10 @@
         self.Project = plcopen.project()
         for child in tree.childNodes:
             if child.nodeType == tree.ELEMENT_NODE and child.nodeName == "project":
-                self.Project.loadXMLTree(child, ["xmlns", "xmlns:xhtml", "xmlns:xsi", "xsi:schemaLocation"])
+                try:
+                    result = self.Project.loadXMLTree(child, ["xmlns", "xmlns:xhtml", "xmlns:xsi", "xsi:schemaLocation"])
+                except ValueError, e:
+                    return _("Project file syntax error:\n\n") + str(e)
                 self.SetFilePath(filepath)
                 self.Project.RefreshElementUsingTree()
                 self.Project.RefreshDataTypeHierarchy()