Changed to finally validate instance documents.

* xstc/xstc.py: Changed to finally validate instance documents.
This commit is contained in:
Kasimier T. Buchcik 2004-09-06 14:26:45 +00:00
parent f31187d31b
commit 6258a4b903
2 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,7 @@
Mon Sep 6 16:42:59 CEST 2004 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xstc/xstc.py: Changed to finally validate instance documents.
Mon Sep 6 16:04:01 CEST 2004 Daniel Veillard <daniel@veillard.com>
* xstc/Makefile.am Makefile.am: integrated to "make valgrind",

View File

@ -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)