Changeset 130 for Xml/Validator/WebApp/validator/OmeValidator.py
- Timestamp:
- 01/09/08 10:55:14 (11 months ago)
- Files:
-
- 1 modified
-
Xml/Validator/WebApp/validator/OmeValidator.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Xml/Validator/WebApp/validator/OmeValidator.py
r120 r130 37 37 return inFilename 38 38 """ 39 # Try to load Image for XML Schema VlaidationSupport39 # Try to load Image for Tiff Support 40 40 haveTiffSupport = True 41 41 try: … … 45 45 haveTiffSupport = False 46 46 47 # Try to load lxml for XML Schema V laidation Support47 # Try to load lxml for XML Schema Validation Support 48 48 haveXsdSupport = True 49 49 try: … … 221 221 # mark xlm as having been parsed 222 222 self.hasParsedXml = True 223 223 224 224 # look at file for Ids, Refs, and namespaces 225 225 self.scanForIdsAndNamespace(inFile) … … 233 233 if self.isXsdValid is True and len(self.errorList) is 0 : 234 234 self.isOmeXml = True 235 235 236 236 def validateAgainstSchema(self): 237 237 if not haveXsdSupport: … … 255 255 256 256 # validating the documnet tree against the loaded schema 257 # this should not throw an exception257 # according to the docs this should not throw an exception - but it does! 258 258 try: 259 259 schema.validate(document) 260 err = schema.error_log.last_error261 if err:260 self.isXsdValid = True 261 for err in schema.error_log: 262 262 self.isXsdValid = False 263 263 self.errorList.append(ParseMessage(None, err.line, None, "XSD", None, err.message)) 264 else:265 self.isXsdValid = True266 264 except etree.XMLSchemaValidateError: 267 265 self.isXsdValid = False 268 self.errorList.append(ParseMessage(None, None, None, "XML", None, " Internal error in the system XML Schema validation module"))266 self.errorList.append(ParseMessage(None, None, None, "XML", None, "Processing the XML data has generated an unspecified error in the XML sub-system. This is usually a result of an incorrect top level block. Please check the OME block is well-formed and that the schemaLocation is specified correctly. This may also be caused by a missing namespace prefix or incorrect xmlns attribute.")) 269 267 270 268 … … 471 469 self.errorList.append(ParseMessage(None, None, None, "TIFF", ("Frames %s out of %s" % (self.tiffFileFrames,totalTiffDataFrames)) , "Not all required frames are present in this Tiff file")) 472 470 self.isOmeTiffConsistent = False 473 471 474 472 # Used by sax parser to handle errors when processing Elements 475 473 class ParseErrorHandler(sax.ErrorHandler):
