You are here

public function MigrateItemsXML::__construct in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 plugins/sources/xml.inc \MigrateItemsXML::__construct()

Overrides MigrateItems::__construct

File

plugins/sources/xml.inc, line 509
Support for migration from XML sources.

Class

MigrateItemsXML
Implementation of MigrateItems, for providing a list of IDs and for retrieving a parsed XML document given an ID from this list.

Code

public function __construct($urls, $item_xpath = 'item', $item_id_xpath = 'id', array $namespaces = array()) {
  parent::__construct();
  if (!is_array($urls)) {
    $urls = array(
      $urls,
    );
  }
  $this->urls = $urls;
  $this->itemXpath = $item_xpath;
  $this->itemIDXpath = $item_id_xpath;
  $this->namespaces = $namespaces;

  // Suppress errors during parsing, so we can pick them up after.
  libxml_use_internal_errors(TRUE);
}