def leaf(self, parent, parts):
name = splitPrefix(parts[-<NUM_LIT:1>])[<NUM_LIT:1>]<EOL>if name.startswith('<STR_LIT:@>'):<EOL><INDENT>result, path = parent.get_attribute(name[<NUM_LIT:1>:])<EOL><DEDENT>else:<EOL><INDENT>result, ancestry = parent.get_child(name)<EOL><DEDENT>if result is None:<EOL><INDENT>raise PathResolver.BadPath(name)<EOL><DEDENT>return result<EOL>
Find the leaf.
@param parts: A list of path parts.
@type parts: [str,..]
@param parent: The leaf's parent.
@type parent: L{xsd.sxbase.SchemaObject}
@return: The leaf.
@rtype: L{xsd.sxbase.SchemaObject}