• Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Change
  • Next Change →

Changeset 119 for Xml/Validator/WebApp/validator/OmeValidator.py

Show
Ignore:
Timestamp:
10/31/07 10:59:01 (14 months ago)
Author:
andrew
Message:

Added block to catch exception from XML parser.

Files:
1 modified

  • Xml/Validator/WebApp/validator/OmeValidator.py (modified) (1 diff)

Legend:

Unmodified
Added
Removed
  • Xml/Validator/WebApp/validator/OmeValidator.py

    r116 r119  
    256256                # validating the documnet tree against the loaded schema 
    257257                # this should not throw an exception 
    258                 schema.validate(document) 
    259                 err = schema.error_log.last_error 
    260                 if err: 
     258                try: 
     259                        schema.validate(document) 
     260                        err = schema.error_log.last_error 
     261                        if err: 
     262                                self.isXsdValid = False 
     263                                self.errorList.append(ParseMessage(None, err.line, None, "XSD", None, err.message)) 
     264                        else: 
     265                                self.isXsdValid = True 
     266                except XMLSchemaValidateError: 
    261267                        self.isXsdValid = False 
    262                         self.errorList.append(ParseMessage(None, err.line, None, "XSD", None, err.message)) 
    263                 else: 
    264                         self.isXsdValid = True 
     268                        self.errorList.append(ParseMessage(None, None, None, "XML", None, "Internal error in the system XML Schema validation module")) 
     269                         
    265270         
    266271        def loadChoosenSchema(self): 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/