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

Context Navigation

  • ← Previous Changeset
  • Next Changeset →

Changeset 158

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

Changes to validator for February 2008 Schema Version 1

Location:
Xml/Validator
Files:
2 added
3 modified
6 moved

  • Backend/OmeValidator.py (modified) (5 diffs)
  • Backend/ome-2007-06-V1.xsd (moved) (moved from Xml/Validator/Backend/ome-2007-07-V1.xsd)
  • Backend/ome-2007-06-V2.xsd (moved) (moved from Xml/Validator/Backend/ome-2007-07-V2.xsd)
  • Backend/ome-2007-06.xsd (moved) (moved from Xml/Validator/Backend/ome-2007-07.xsd)
  • Backend/ome-2008-02-V1.xsd (added)
  • Validator - Back & Front.tmproj (modified) (2 diffs)
  • WebApp/schema/ome-2007-06-V1.xsd (moved) (moved from Xml/Validator/WebApp/schema/ome-2007-07-V1.xsd)
  • WebApp/schema/ome-2007-06-V2.xsd (moved) (moved from Xml/Validator/WebApp/schema/ome-2007-07-V2.xsd)
  • WebApp/schema/ome-2007-06.xsd (moved) (moved from Xml/Validator/WebApp/schema/ome-2007-07.xsd)
  • WebApp/schema/ome-2008-02-V1.xsd (added)
  • WebApp/validator/OmeValidator.py (modified) (5 diffs)

Legend:

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

    r131 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 
    … …  
    757768        for aFilename in ["samples/completesamplenopre.xml","samples/completesample.xml","samples/completesamplenoenc.xml", 
    758769                        "samples/sdub.ome", "samples/sdub-fix.ome", "samples/sdub-fix-pre.ome",  
    759                         "samples/tiny.ome", "samples/broke.ome"]: 
     770                        "samples/tiny.ome", "samples/broke.ome", 
     771                        "samples/tiny2008-02-V1.ome"]: 
    760772                        print "============ XML file %s ============ " % aFilename 
    761773                        print XmlReport.validateFile(aFilename) 
  • Xml/Validator/Validator - Back & Front.tmproj

    r142 r158  
    1717        </array> 
    1818        <key>fileHierarchyDrawerWidth</key> 
    19         <integer>200</integer> 
     19        <integer>219</integer> 
    2020        <key>metaData</key> 
    2121        <dict/> 
    … …  
    2323        <true/> 
    2424        <key>windowFrame</key> 
    25         <string>{{194, 156}, {1041, 828}}</string> 
     25        <string>{{0, 49}, {1367, 1129}}</string> 
    2626</dict> 
    2727</plist> 
  • 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/