You are here

public function DOMXPath::__construct in Feeds XPath Parser 8

Constructs a DOMXPath object.

Parameters

\DOMDocument $doc: The DOMDocument that we're operating on.

Overrides DOMXPath::__construct

1 method overrides DOMXPath::__construct()
DOMXPath::__construct in lib/Drupal/feeds_xpathparser/DOMXPath.php
Constructs a DOMXPath object.

File

lib/Drupal/feeds_xpathparser/DOMXPath.php, line 56
Contains \Druapl\feeds_xpathparser\DOMXPath.

Class

DOMXPath
Wraps DOMXPath providing enhanced debugging and special namespace handling.

Namespace

Drupal\feeds_xpathparser

Code

public function __construct(\DOMDocument $doc) {
  $simple = simplexml_import_dom($doc);

  // An empty DOMDocument will make $simple NULL.
  if ($simple !== NULL) {
    $this->namespaces = $simple
      ->getNamespaces(TRUE);
  }
  $this->doc = $doc;
  parent::__construct($doc);
}