- Timestamp:
- 29/01/07 15:43:18 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI02-CSML/trunk/csml/csml2Moles/molesReadWrite.py
r2065 r2074 40 40 if subsubelem.tag=='{http://www.w3.org/2001/XMLSchema}sequence': 41 41 __addSequence(molesclassname,subsubelem) 42 42 43 if elem.tag == '{http://www.w3.org/2001/XMLSchema}element': 43 44 '''Look for parents of complex types - sometimes a complexType is declared but does not have a name and … … 50 51 if subsubelem.tag=='{http://www.w3.org/2001/XMLSchema}sequence': 51 52 __addSequence(molesclassname,subsubelem) 53 52 54 '''this bit handles the use of types. If some element has a name and a type attribute then if that type is complex it has 53 55 the same sequence as the type e.g. <xs:element name="dataModelID" type="moles:dgMetadataIDType"> … … 70 72 def lookupOrder(self, dict,classname): 71 73 '''takes the attributes in a dictionary and orders them according to the schema sequence''' 72 try: 74 try: 73 75 order=self.sequences[classname] 74 #print classname75 #print order76 76 except KeyError: 77 #print 'keyerror %s!'%classname78 77 order = [] 79 78 for key in dict: 80 order.append(dict[key]) # if it can't be found an unordered list is returned from the original dictionary items 79 #print key 80 if key is not 'schema': 81 if key is not 'ns': 82 order.append(key) # if it can't be found an unordered list is returned from the original dictionary items 83 #print 'returning %s'%order 81 84 return order 82 85 … … 128 131 else: 129 132 self.schema=None 133 print molesFrag.tag 130 134 orderedAttribs=schema.lookupOrder(self.__dict__,molesFrag.tag) 131 135 for item in orderedAttribs: 132 #print "item in orderedAttribs is %s" %item136 print "item in orderedAttribs is %s" %item 133 137 if type(item) is xmlSchema: 134 138 continue
Note: See TracChangeset
for help on using the changeset viewer.