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

Context Navigation

  • ← Previous Change
  • Next Change →

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

Show
Ignore:
Timestamp:
02/28/08 14:27:44 (9 months ago)
Author:
andrew
Message:

Changes to validator for February 2008 Schema Version 1

Files:
1 modified

  • Xml/Validator/WebApp/validator/OmeValidator.py (modified) (5 diffs)

Legend:

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

    r141 r158  
    274274                        self.isXsdValid = False 
    275275                        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.")) 
    276          
     276 
    277277        def checkOldSchemas(self, inDocument): 
    278                 for thePossibleSchema in [["ome-2007-07-V2.xsd","September 2007 V2"],["ome-2007-07-V1.xsd","June 2007 V1"],["ome-fc-tiff.xsd","2003 - Tiff Variant"], ["ome-fc.xsd","2003 - Standard version"]]: 
     278                for thePossibleSchema in [["ome-2008-02-V1.xsd","February 2008 V2"],["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: 
    … …  
    298298                # choose the schema source 
    299299                # assume the new schema 
    300                 self.theSchemaFile = "ome-2007-07-V2.xsd" 
     300                self.theSchemaFile = "ome-2008-02-V1.xsd" 
    301301                # if old schema 
    302302                if self.theNamespace == "http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd": 
    … …  
    308308                                # use normal version of old schema 
    309309                                self.theSchemaFile = "ome-fc.xsd" 
     310                else: 
     311                        if self.theNamespace == "http://www.openmicroscopy.org/Schemas/OME/2007-06": 
     312                                # use September 2007 schema 
     313                                self.theSchemaFile = "ome-2007-06-V2.xsd" 
     314 
    310315                 
    311316                # loading the OME schema to validate against 
    … …  
    598603                                        if name[-5:] == "Image": 
    599604                                                try: 
    600                                                         # in Image - ID is an ID and DefaultPixels is a Reference 
     605                                                        # in Image - ID is an ID  
     606                                                        # and DefaultPixels is a Reference 
    601607                                                        self.references.append(attribs.getValue("DefaultPixels")) 
     608                                                except KeyError: 
     609                                                        pass 
     610                                                try: 
     611                                                        # and AcquiredPixels is a Reference 
     612                                                        self.references.append(attribs.getValue("AcquiredPixels")) 
    602613                                                except KeyError: 
    603614                                                        pass 
    … …  
    748759        for aFilename in ["samples/completesamplenopre.xml","samples/completesample.xml","samples/completesamplenoenc.xml", 
    749760                        "samples/sdub.ome", "samples/sdub-fix.ome", "samples/sdub-fix-pre.ome",  
    750                         "samples/tiny.ome", "samples/broke.ome"]: 
     761                        "samples/tiny.ome", "samples/broke.ome", 
     762                        "samples/tiny2008-02-V1.ome"]: 
    751763                        print "============ XML file %s ============ " % aFilename 
    752764                        print XmlReport.validateFile(aFilename) 

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/