protected function XmlTrait::registerNamespaces in Migrate Plus 8.2
Same name and namespace in other branches
- 8.5 src/Plugin/migrate_plus/data_parser/XmlTrait.php \Drupal\migrate_plus\Plugin\migrate_plus\data_parser\XmlTrait::registerNamespaces()
- 8.3 src/Plugin/migrate_plus/data_parser/XmlTrait.php \Drupal\migrate_plus\Plugin\migrate_plus\data_parser\XmlTrait::registerNamespaces()
- 8.4 src/Plugin/migrate_plus/data_parser/XmlTrait.php \Drupal\migrate_plus\Plugin\migrate_plus\data_parser\XmlTrait::registerNamespaces()
Registers the iterator's namespaces to a SimpleXMLElement.
Parameters
\SimpleXMLElement $xml: The element to apply namespace registrations to.
2 calls to XmlTrait::registerNamespaces()
- SimpleXml::openSourceUrl in src/
Plugin/ migrate_plus/ data_parser/ SimpleXml.php - Opens the specified URL.
- Xml::getSimpleXml in src/
Plugin/ migrate_plus/ data_parser/ Xml.php - Builds a \SimpleXmlElement rooted at the iterator's current location.
File
- src/
Plugin/ migrate_plus/ data_parser/ XmlTrait.php, line 16
Class
- XmlTrait
- Common functionality for XML data parsers.
Namespace
Drupal\migrate_plus\Plugin\migrate_plus\data_parserCode
protected function registerNamespaces(\SimpleXMLElement $xml) {
if (isset($this->configuration['namespaces']) && is_array($this->configuration['namespaces'])) {
foreach ($this->configuration['namespaces'] as $prefix => $ns) {
$xml
->registerXPathNamespace($prefix, $ns);
}
}
}