def fromSchema(self, schema):
ns = schema.getTargetNamespace()<EOL>assert self.targetNamespace is None or self.targetNamespace == ns,'<STR_LIT>'%(self.targetNamespace, ns)<EOL>if self.targetNamespace is None:<EOL><INDENT>self.targetNamespace = ns<EOL><DEDENT>self.classHead.ns = self.classFoot.ns = ns<EOL>for item in [t for t in schema.types if t.getAttributeName() not in self.__types]:<EOL><INDENT>self.__types.append(item.getAttributeName())<EOL>self.items.append(TypeWriter(do_extended=self.do_extended, extPyClasses=self.extPyClasses))<EOL>self.items[-<NUM_LIT:1>].fromSchemaItem(item)<EOL><DEDENT>for item in [e for e in schema.elements if e.getAttributeName() not in self.__elements]:<EOL><INDENT>self.__elements.append(item.getAttributeName())<EOL>self.items.append(ElementWriter(do_extended=self.do_extended))<EOL>self.items[-<NUM_LIT:1>].fromSchemaItem(item)<EOL><DEDENT>
Can be called multiple times, but will not redefine a
        previously defined type definition or element declaration.