You are here

public function FeedsXPathParserDOMXPath::__construct in Feeds XPath Parser 7

Same name and namespace in other branches
  1. 6 FeedsXPathParserDOMXPath.inc \FeedsXPathParserDOMXPath::__construct()

Constructs a FeedsXPathParserDOMXPath object.

Parameters

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

File

./FeedsXPathParserDOMXPath.inc, line 54
Provides a custom version of DOMXPath for use with feeds_xpathparser.

Class

FeedsXPathParserDOMXPath
Wraps DOMXPath providing enhanced debugging and special namespace handling.

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);
}