You are here

public function MigrateItemsXML::xml in Migrate 6.2

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

Load and return the xml from the defined xmlUrl.

Return value

SimpleXMLElement

3 calls to MigrateItemsXML::xml()
MigrateItemsXML::computeCount in plugins/sources/xml.inc
Return a count of all available IDs from the source listing.
MigrateItemsXML::getAllItems in plugins/sources/xml.inc
Load the XML at the given URL, and return an array of the Items found within it.
MigrateItemsXML::getIdList in plugins/sources/xml.inc
Load the XML at the given URL, and return an array of the IDs found within it.

File

plugins/sources/xml.inc, line 357
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 &xml() {
  if (!$this->xml && !empty($this->xmlUrl)) {
    $this->xml = simplexml_load_file($this->xmlUrl);
    if (!$this->xml) {
      Migration::displayMessage(t('Loading of !xmlUrl failed:', array(
        '!xmlUrl' => $this->xmlUrl,
      )));
      foreach (libxml_get_errors() as $error) {
        Migration::displayMessage(self::parseLibXMLError($error));
      }
    }
  }
  return $this->xml;
}