def branch(self, root, parts):
result = root<EOL>for part in parts[<NUM_LIT:1>:-<NUM_LIT:1>]:<EOL><INDENT>name = splitPrefix(part)[<NUM_LIT:1>]<EOL>log.debug('<STR_LIT>', Repr(result), name)<EOL>result, ancestry = result.get_child(name)<EOL>if result is None:<EOL><INDENT>log.error('<STR_LIT>', name)<EOL>raise PathResolver.BadPath(name)<EOL><DEDENT>else:<EOL><INDENT>result = result.resolve(nobuiltin=True)<EOL>log.debug('<STR_LIT>', name, Repr(result))<EOL><DEDENT><DEDENT>return result<EOL>
Traverse the path until the leaf is reached.
@param parts: A list of path parts.
@type parts: [str,..]
@param root: The root.
@type root: L{xsd.sxbase.SchemaObject}
@return: The end of the branch.
@rtype: L{xsd.sxbase.SchemaObject}