PHPExiftool\RDFParser::getDomXpath PHP Method

getDomXpath() protected method

Compute the DOMXpath from the DOMDocument
protected getDomXpath ( ) : DOMXpath
return DOMXpath The DOMXpath object related to the XML
    protected function getDomXpath()
    {
        if (!$this->DOMXpath) {
            try {
                $this->DOMXpath = new \DOMXPath($this->getDom());
            } catch (ParseError $e) {
                throw new RuntimeException('Unable to parse the XML');
            }
            $this->DOMXpath->registerNamespace('rdf', self::RDF_NAMESPACE);
            foreach (static::getNamespacesFromXml($this->getDom()) as $prefix => $uri) {
                $this->registeredPrefixes = array_merge($this->registeredPrefixes, (array) $prefix);
                $this->DOMXpath->registerNamespace($prefix, $uri);
            }
        }
        return $this->DOMXpath;
    }