def getSchemaItem(self, collection, namespace, name):
parent = GetSchema(self)<EOL>if parent.targetNamespace == namespace:<EOL><INDENT>try:<EOL><INDENT>obj = getattr(parent, collection)[name]<EOL><DEDENT>except KeyError as ex:<EOL><INDENT>raise KeyError('<STR_LIT>'%(namespace, collection, name))<EOL><DEDENT>return obj<EOL><DEDENT>if namespace not in parent.imports:<EOL><INDENT>if namespace in BUILT_IN_NAMESPACES:            <EOL><INDENT>return<EOL><DEDENT>raise SchemaError('<STR_LIT>' %(<EOL>parent.targetNamespace, namespace))<EOL><DEDENT>schema = parent.imports[namespace]<EOL>if not isinstance(schema, XMLSchema):<EOL><INDENT>schema = schema.getSchema()    <EOL>if schema is not None:<EOL><INDENT>parent.imports[namespace] = schema<EOL><DEDENT><DEDENT>if schema is None:<EOL><INDENT>if namespace in BUILT_IN_NAMESPACES:<EOL><INDENT>return<EOL><DEDENT>raise SchemaError('<STR_LIT>'%(namespace))<EOL><DEDENT>if not isinstance(schema, XMLSchema):<EOL><INDENT>raise TypeError('<STR_LIT>' %schema)<EOL><DEDENT>try:<EOL><INDENT>obj = getattr(schema, collection)[name]<EOL><DEDENT>except KeyError as ex:<EOL><INDENT>raise KeyError('<STR_LIT>'%(namespace, collection, name))<EOL><DEDENT>return obj<EOL>
returns object instance representing namespace, name,
           or if does not exist return None if built-in, else
           raise SchemaError.

           namespace -- namespace item defined in.
           name -- name of item.
           collection -- collection in parent Schema instance to search.