QueryPath\DOMQuery::top PHP Method

top() public method

This sets the current match to the document's root element. For practical purposes, this is the same as:
public top ( string $selector = null )
$selector string A selector. If this is supplied, QueryPath will navigate to the document root and then run the query. (Added in QueryPath 2.0 Beta 2)
    public function top($selector = null)
    {
        //$this->setMatches($this->document->documentElement);
        //return !empty($selector) ? $this->find($selector) : $this;
        return $this->inst($this->document->documentElement, $selector, $this->options);
    }