diff options
author | Kasimier T. Buchcik <kbuchcik@src.gnome.org> | 2004-09-06 14:26:45 +0000 |
---|---|---|
committer | Kasimier T. Buchcik <kbuchcik@src.gnome.org> | 2004-09-06 14:26:45 +0000 |
commit | 6258a4b903e41db9ea00ef66c9d3b57fd6db1163 (patch) | |
tree | 9891874cd23f16cc592aab0aba7469bf361f61f4 /xstc | |
parent | f31187d31be0303c3844186ec01cb8fc819addf5 (diff) | |
download | libxml2-6258a4b903e41db9ea00ef66c9d3b57fd6db1163.tar.gz |
Changed to finally validate instance documents.
* xstc/xstc.py: Changed to finally validate instance documents.
Diffstat (limited to 'xstc')
-rwxr-xr-x | xstc/xstc.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xstc/xstc.py b/xstc/xstc.py index 6838e5e6..96c4f065 100755 --- a/xstc/xstc.py +++ b/xstc/xstc.py @@ -258,6 +258,7 @@ class MSTestCase: else: self.fail(msgSchemaValidButShouldNot) else: + return schema self.debugMsg("schema result is OK") self.debugMsg("after checking schema result") @@ -265,7 +266,7 @@ class MSTestCase: global msgInstanceNotValidButShould, msgInstanceValidButShouldNot instance = None - self.debugMsg("loading instance: %s" % file) + self.debugMsg("loading instance: %s" % filePath) instance_parserCtxt = libxml2.newParserCtxt() if (instance_parserCtxt is None): # TODO: Is this one necessary, or will an exception @@ -273,7 +274,7 @@ class MSTestCase: raise Exception("Could not create the instance parser context.") try: try: - instance = instance_parserCtxt.ctxtReadFile(file, None, libxml2.XML_PARSE_NOWARNING) + instance = instance_parserCtxt.ctxtReadFile(filePath, None, libxml2.XML_PARSE_NOWARNING) except: # Suppress exceptions. pass @@ -324,13 +325,13 @@ class MSTestCase: schema = self.processSchema(filePath) try: if self.instance_Exists and (schema is not None) and (not self.failed): - file = "%s/%s/%s/%s" % (options.baseDir, self.test_Folder, self.instance_Folder, self.instance_File) - processInstance(filePath, schema) + filePath = "%s/%s/%s/%s" % (options.baseDir, self.test_Folder, self.instance_Folder, self.instance_File) + self.processInstance(filePath, schema) finally: if schema is not None: del schema - except Exception, e: + except (Exception, libxml2.parserError, libxml2.treeError), e: self.failExcept(e) |