return result for a call to lxml ElementPath find()
188605
def find(self, expression):
        """"""
        self.__expression = expression
        return self.__doc.find(self.__expression)
976130
def xpathNextChild(self, cur):
        
        if cur is None: cur__o = None
        else: cur__o = cur._o
        ret = libxml2mod.xmlXPathNextChild(self._o, cur__o)
        if ret is None:raise xpathError('xmlXPathNextChild() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
1224385
def contextNode(self):
        
        ret = libxml2mod.xmlXPathGetContextNode(self._o)
        if ret is None:raise xpathError('xmlXPathGetContextNode() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
345164
def _find_value(content, ns, key):
    
    doc = ElementTree.fromstring(content)
    query = './/{%(ns)s}%(item)s' % {'ns': ns, 'item': key}
    rv = doc.find(query)
    return rv.text
967117
def xpath(self, xpath, dom=None):
        """"""
        if dom is None:
            dom = self.browser
        return expect(dom.find_by_xpath, args=[xpath])
774711
function find($selector, $idx=null, $lowercase=false)
	{
		$selectors = $this->parse_selector($selector);
		if (($count=count($selectors))===0) return array();
		$found_keys = array();

		// find each selector
		for ($c=0; $c<$count; ++$c)
		{
			// The change on the below line was documented on the sourceforge code tracker id 2788009
			// used to be: if (($levle=count($selectors[0]))===0) return array();
			if (($levle=count($selectors[$c]))===0) return array();
			if (!isset($this->_[HDOM_INFO_BEGIN])) return array();

			$head = array($this->_[HDOM_INFO_BEGIN]=>1);

			// handle descendant selectors, no recursive!
			for ($l=0; $l<$levle; ++$l)
			{
				$ret = array();
				foreach ($head as $k=>$v)
				{
					$n = ($k===-1) ? $this->dom->root : $this->dom->nodes[$k];
					//PaperG - Pass this optional parameter on to the seek function.
					$n->seek($selectors[$c][$l], $ret, $lowercase);
				}
				$head = $ret;
			}

			foreach ($head as $k=>$v)
			{
				if (!isset($found_keys[$k]))
				{
					$found_keys[$k] = 1;
				}
			}
		}

		// sort keys
		ksort($found_keys);

		$found = array();
		foreach ($found_keys as $k=>$v)
			$found[] = $this->dom->nodes[$k];

		// return nth-element or array
		if (is_null($idx)) return $found;
		else if ($idx<0) $idx = count($found) + $idx;
		return (isset($found[$idx])) ? $found[$idx] : null;
	}
314786
def xpathNextParent(self, cur):
        
        if cur is None: cur__o = None
        else: cur__o = cur._o
        ret = libxml2mod.xmlXPathNextParent(self._o, cur__o)
        if ret is None:raise xpathError('xmlXPathNextParent() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
404337
public List<String> getAllXPath(NamespaceContext context, String xml, String xPathExpr) {
        List<String> result = null;
        
        NodeList nodes = (NodeList) evaluateXpath(context, xml, xPathExpr, XPathConstants.NODESET);
        if (nodes != null) {
            result = new ArrayList<String>(nodes.getLength());
            for (int i = 0; i < nodes.getLength(); i++) {
                result.add(nodes.item(i).getNodeValue());
            }
        }

        return result;
    }
206086
def elemgetter(path: str) -> t.Callable[[Element], Element]:
    """"""
    return compose(
        partial(_raise_if_none, exc=LookupError(path)),
        methodcaller('find', path)
    )
1300074
def _element_find_from_root(
        root,  # type: ET.Element
        element_path  # type: Text
):
    # type: (...) -> Optional[ET.Element]
    
    element = None

    element_names = element_path.split('/')
    if element_names[0] == root.tag:
        if len(element_names) > 1:
            element = root.find('/'.join(element_names[1:]))
        else:
            element = root

    return element
164214
def find_elements_by_xpath(self, xpath):
        
        from sdklib.html.elem import Elem5lib

        return [Elem5lib(e) for e in self.html_obj.findall(self._convert_xpath(xpath))]
1359777
def getXMLDescription(cliExecutable, **kwargs):
    """"""

    command = [cliExecutable, '--xml']
    
    stdout, stdoutFilename = tempfile.mkstemp('.stdout')
    stderr, stderrFilename = tempfile.mkstemp('.stderr')
    try:
        p = popenCLIExecutable(command, stdout = stdout, stderr = stderr, **kwargs)
        ec = p.wait()
        with open(stderrFilename) as f:
            for line in f:
                logger.warning('%s: %s' % (os.path.basename(cliExecutable), line[:-1]))
        if ec:
            raise RuntimeError("Calling %s failed (exit code %d)" % (cliExecutable, ec))
        with open(stdoutFilename) as f:
            return ET.parse(f)
    finally:
        os.close(stdout)
        os.close(stderr)
        os.unlink(stdoutFilename)
        os.unlink(stderrFilename)
861300
def textgetter(path: str, *,
               default: T=NO_DEFAULT,
               strip: bool=False) -> t.Callable[[Element], t.Union[str, T]]:
    """"""
    find = compose(
        str.strip if strip else identity,
        partial(_raise_if_none, exc=LookupError(path)),
        methodcaller('findtext', path)
    )
    return (find if default is NO_DEFAULT else lookup_defaults(find, default))
661774
def xpathEvalExpression(self, str):
        
        ret = libxml2mod.xmlXPathEvalExpression(str, self._o)
        if ret is None:raise xpathError('xmlXPathEvalExpression() failed')
        return xpathObjectRet(ret)
338831
function fullPath(el){
  var names = [];
  while (el.parentNode){
    if (el.id){
      names.unshift('#'+el.id);
      break;
    }else{
      if (el==el.ownerDocument.documentElement) names.unshift(el.tagName);
      else{
        for (var c=1,e=el;e.previousElementSibling;e=e.previousElementSibling,c++);
        names.unshift(el.tagName+":nth-child("+c+")");
      }
      el=el.parentNode;
    }
  }
  return names.join(" > ");
}
130209
function hasDirectTextDescendantXpath() {
        var selectorResults = ownerDocument.evaluate(axs.properties.TEXT_CONTENT_XPATH,
                                                     element,
                                                     null,
                                                     XPathResult.ANY_TYPE,
                                                     null);
        for (var resultElement = selectorResults.iterateNext();
             resultElement != null;
             resultElement = selectorResults.iterateNext()) {
            if (resultElement !== element)
                continue;
            return true;
        }
        return false;
    }
486801
def _get_el_attributes(lxml_el, ns=None, nsmap=None):
    
    attrs = {}
    for attr, val in lxml_el.items():
        attr = _to_colon_ns(attr, default_ns=ns, nsmap=nsmap)
        attrs[attr] = val
    return attrs