Changeset 80 for Xml/Validator/Backend/OmeValidator.py
- Timestamp:
- 08/17/07 15:28:32 (15 months ago)
- Files:
-
- 1 modified
-
Xml/Validator/Backend/OmeValidator.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Xml/Validator/Backend/OmeValidator.py
r79 r80 401 401 ''' 402 402 # pull the namespace out of the OME element 403 if name[-3] == "OME": 404 try: 405 self.theNamespace = attribs.getValue("xmlns") 406 except KeyError: 407 self.theNamespace = "" 403 if name[-3:] == "OME": 404 if name[-4:] == ":OME": 405 # a prefex is being used 406 self.thePrefix = name[:-4] 407 print "Prefix : %s" % self.thePrefix 408 try: 409 self.theNamespace = attribs.getValue("xmlns" + ':' + self.thePrefix) 410 except KeyError: 411 self.theNamespace = "" 412 else: 413 try: 414 self.theNamespace = attribs.getValue("xmlns") 415 except KeyError: 416 self.theNamespace = "" 408 417 409 418 # save the ID in any elements encountered … … 500 509 self.theNamespace = None 501 510 502 def startElement(self, name, attr s):511 def startElement(self, name, attribs): 503 512 ''' 504 513 Examine each element in turn and check of the main OME element 505 514 ''' 506 if name == "OME": 507 try: 508 # pull the namespace out of the OME element 509 self.theNamespace = attrs["xmlns"] 510 except KeyError: 511 # assume default namespace 512 self.theNamespace = "" 515 # pull the namespace out of the OME element 516 if name[-3:] == "OME": 517 if name[-4:] == ":OME": 518 # a prefex is being used 519 self.thePrefix = name[:-4] 520 print "Prefix : %s" % self.thePrefix 521 try: 522 # pull the namespace for prefix out of the OME element 523 self.theNamespace = attribs.getValue("xmlns" + ':' + self.thePrefix) 524 except KeyError: 525 # assume default namespace 526 self.theNamespace = "" 527 else: 528 try: 529 # pull the namespace out of the OME element 530 self.theNamespace = attribs.getValue("xmlns") 531 except KeyError: 532 self.theNamespace = "" 513 533 #finally: 514 534 # the OME node has been found (even if it does not have a
