def FindLocalHREF(self, href, elt, headers=<NUM_LIT:1>):
if href[<NUM_LIT:0>] != '<STR_LIT:#>':<EOL><INDENT>raise EvaluateException(<EOL>'<STR_LIT>' % href,<EOL>self.Backtrace(elt))<EOL><DEDENT>frag = href[<NUM_LIT:1>:]<EOL>e = self.id_cache.get(frag)<EOL>if e: return e<EOL>list = self.data_elements[:] + [self.body_root]<EOL>if headers: list.extend(self.header_elements)<EOL>while list:<EOL><INDENT>e = list.pop()<EOL>if e.nodeType == _Node.ELEMENT_NODE:<EOL><INDENT>nodeid = _find_id(e)<EOL>if nodeid:<EOL><INDENT>self.id_cache[nodeid] = e<EOL>if nodeid == frag: return e<EOL><DEDENT><DEDENT>list += _children(e)<EOL><DEDENT>raise EvaluateException('''<STR_LIT>''' % href,<EOL>self.Backtrace(elt))<EOL>
Find a local HREF in the data elements.