def findattr(self, name, resolved=True):
name = '<STR_LIT>'%name<EOL>parent = self.top().resolved<EOL>if parent is None:<EOL><INDENT>result, ancestry = self.query(name, node)<EOL><DEDENT>else:<EOL><INDENT>result, ancestry = self.getchild(name, parent)<EOL><DEDENT>if result is None:<EOL><INDENT>return result<EOL><DEDENT>if resolved:<EOL><INDENT>result = result.resolve()<EOL><DEDENT>return result<EOL>
Find an attribute type definition.
@param name: An attribute name.
@type name: basestring
@param resolved: A flag indicating that the fully resolved type should be
    returned.
@type resolved: boolean
@return: The found schema I{type}
@rtype: L{xsd.sxbase.SchemaObject}