Package pyxsd :: Package elementRepresentatives :: Module schema
[hide private]
[frames] | no frames]

Source Code for Module pyxsd.elementRepresentatives.schema

 1  from complexType import ComplexType 
 2   
 3  #============================================================ 
 4  # 
5 -class Schema(ComplexType):
6 """ 7 The class for the schema tag. Subclass of *ComplexType*, becuase it is so similar to it. 8 """ 9 #============================================================ 10 #
11 - def __init__(self, xsdElement, parent):
12 """ 13 Stores all the attributeGroups, complexTypes, and simpleTypes in the document in dictionaries. Also has a list of top-level elements (should be only one). 14 See *ElementRepresentative* for more documentation. 15 """ 16 self.attributeGroups = {} 17 self.complexTypes = {} 18 self.simpleTypes = {} 19 self.elements = [] 20 21 ComplexType.__init__(self, xsdElement, parent)
22 23 #============================================================ 24 #
25 - def getName(self):
26 """ 27 returns 'schema' 28 """ 29 return 'schema'
30 31 #============================================================ 32 #
33 - def getElements(self):
34 """ 35 Returns a list of elements. 36 37 No parameters 38 """ 39 oldElements = getattr(self, 'elements_', None) 40 41 if not oldElements == None: 42 return oldElements 43 44 self.elements_ = [] 45 46 47 for element in self.elements: 48 self.elements_.append(element) 49 return self.elements_
50 51 #============================================================ 52 #
53 - def getSchema(self):
54 """ 55 returns the schema ER obj. In ER, a method with the same name points down to the method by the same name in its parent. 56 """ 57 return self
58