def createClazz(prefix, element, processed): logging.debug("Generating class for: %s" % element) elementCleanName = get_clazz_name_from_element(element) processed.append(elementCleanName) if Clazz.ClazzDict.has_key(elementCleanName): return Clazz.ClazzDict[elementCleanName] parentName, base = getParentName(element) logging.debug("Element base: %s" % base) if not element.isExplicitDefine(): logging.debug("Not an explicit define, returning.") return if element.getSimpleContent(): logging.debug("Simple content, returning.") return # If this element is an extension (has a base) and the base has # not been generated, then postpone it. if parentName: if (parentName not in AlreadyGenerated and parentName not in SimpleTypeDict.keys()): PostponedExtensions.append(element) return elementName = element.getName() if elementName in AlreadyGenerated: return AlreadyGenerated.append(elementName) if element.getMixedExtensionError(): err_msg( '*** Element %s extension chain contains mixed and non-mixed content. Not generated.\n' % (element.getName(), )) return new_clazz = Clazz(prefix, elementCleanName, parentName, element) # the access key form XSchemaElements to Clazzes is the # get_clazz_name_from_element(element) Clazz.ClazzDict[elementCleanName] = new_clazz createClazzMembers(new_clazz, element) parentName, dummy = getParentName(element) if parentName and parentName in AlreadyGenerated: new_clazz.parentName = mapName(cleanupName(parentName))