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

Context Navigation

  • ← Previous Change
  • Next Change →

Changeset 227 for Xml/Validator/Backend/OmeValidator.py

Show
Ignore:
Timestamp:
11/20/08 15:37:01 (7 weeks ago)
Author:
andrew
Message:

Updated to also check 2008-09-V1 schema

Files:
1 modified

  • Xml/Validator/Backend/OmeValidator.py (modified) (7 diffs)

Legend:

Unmodified
Added
Removed
  • Xml/Validator/Backend/OmeValidator.py

    r185 r227  
    276276 
    277277        def checkOldSchemas(self, inDocument): 
    278                 for thePossibleSchema in [["ome-2008-02-V2.xsd","February 2008 V2"],["ome-2008-02-V1.xsd","February 2008 V1"],["ome-2007-06-V2.xsd","September 2007 V2"],["ome-2007-06-V1.xsd","June 2007 V1"],["ome-fc-tiff.xsd","2003 - Tiff Variant"], ["ome-fc.xsd","2003 - Standard version"]]: 
     278                for thePossibleSchema in [["ome-2008-09-V1.xsd","September 2008 V1"],["ome-2008-02-V2.xsd","February 2008 V2"],["ome-2008-02-V1.xsd","February 2008 V1"],["ome-2007-06-V2.xsd","September 2007 V2"],["ome-2007-06-V1.xsd","June 2007 V1"],["ome-fc-tiff.xsd","2003 - Tiff Variant"], ["ome-fc.xsd","2003 - Standard version"]]: 
    279279                        # skip current one 
    280280                        if not thePossibleSchema[0] == self.theSchemaFile: 
    … …  
    284284                                except: 
    285285                                        # chosen schema failed to laod 
    286                                         self.errorList.append(ParseMessage(None, None, None, "XSD", None, "Validator Internal error: XSD schema file could not be found")) 
     286                                        self.errorList.append(ParseMessage(None, None, None, schemaFilePath(thePossibleSchema[0]), None, "Validator Internal error: XSD schema file could not be found [2]")) 
    287287                                # try validation 
    288288                                try: 
    … …  
    298298                # choose the schema source 
    299299                # assume the new schema 
    300                 self.theSchemaFile = "ome-2008-02-V2.xsd" 
     300                self.theSchemaFile = "ome-2008-09-V1.xsd" 
    301301                # if old schema 
    302302                if self.theNamespace == "http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd": 
    … …  
    312312                                # use September 2007 schema 
    313313                                self.theSchemaFile = "ome-2007-06-V2.xsd" 
     314                        else: 
     315                                if self.theNamespace == "http://www.openmicroscopy.org/Schemas/OME/2008-02": 
     316                                        # use February 2007 schema 
     317                                        self.theSchemaFile = "ome-2008-02-V2.xsd" 
    314318 
    315319                 
    … …  
    319323                except: 
    320324                        # chosen schema failed to laod 
    321                         self.errorList.append(ParseMessage(None, None, None, "XSD", None, "Validator Internal error: XSD schema file could not be found")) 
     325                        self.errorList.append(ParseMessage(None, None, None, "XSD", None, "Validator Internal error: XSD schema file could not be found [1]")) 
    322326                        schema = None; 
    323327                         
    … …  
    773777if __name__ == '__main__': 
    774778        for aFilename in ["samples/completesamplenopre.xml","samples/completesample.xml","samples/completesamplenoenc.xml", 
    775                         "samples/sdub.ome", "samples/sdub-fix.ome", "samples/sdub-fix-pre.ome",  
    776                         "samples/tiny.ome", "samples/broke.ome", 
    777                         "samples/tiny2008-02-V1.ome"]: 
     779                        "samples/sdub.ome", "samples/sdub-fix.ome", "samples/sdub-fix-pre.ome",  
     780                        "samples/tiny.ome", "samples/broke.ome", 
     781                        "samples/tiny2008-02-V1.ome", "samples/tiny2008-09-V1.ome"]: 
    778782                        print "============ XML file %s ============ " % aFilename 
    779783                        print XmlReport.validateFile(aFilename) 
    … …  
    787791         
    788792        print "============" 
     793 
     794### 

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/