FluentDOM\Document::xpath PHP Method

xpath() public method

Generate an xpath instance for the document, if the document of the xpath instance does not match the document, regenerate it.
public xpath ( ) : Xpath
return Xpath
    public function xpath()
    {
        if (isset($this->_xpath) && (\FluentDOM::$isHHVM || $this->_xpath->document === $this)) {
            return $this->_xpath;
        }
        $this->_xpath = new Xpath($this);
        foreach ($this->_namespaces as $prefix => $namespace) {
            $this->_xpath->registerNamespace($prefix, $namespace);
        }
        return $this->_xpath;
    }