You are here

private function Crawler::createDOMXPath in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dom-crawler/Crawler.php \Symfony\Component\DomCrawler\Crawler::createDOMXPath()

Parameters

\DOMDocument $document:

array $prefixes:

Return value

\DOMXPath

Throws

\InvalidArgumentException

1 call to Crawler::createDOMXPath()
Crawler::filterRelativeXPath in vendor/symfony/dom-crawler/Crawler.php
Filters the list of nodes with an XPath expression.

File

vendor/symfony/dom-crawler/Crawler.php, line 953

Class

Crawler
Crawler eases navigation of a list of \DOMElement objects.

Namespace

Symfony\Component\DomCrawler

Code

private function createDOMXPath(\DOMDocument $document, array $prefixes = array()) {
  $domxpath = new \DOMXPath($document);
  foreach ($prefixes as $prefix) {
    $namespace = $this
      ->discoverNamespace($domxpath, $prefix);
    if (null !== $namespace) {
      $domxpath
        ->registerNamespace($prefix, $namespace);
    }
  }
  return $domxpath;
}