/** * Зарегистрировать namespace * * @param WalkerXML $element * @param string $value namespace. */ private function registerNamespace(WalkerXML &$element, $value) { if (!empty($element->getNamespaces())) { $element->registerXPathNamespace($value, $element->getNamespaces()['']); $element->namespace = $value; } }
/** * @param string $data * @param EventDispatcherInterface $dispatcher */ public function __construct($data, EventDispatcherInterface $dispatcher) { $this->dispatcher = $dispatcher; $this->xml = new WalkerXML($data); if (!empty($this->xml->getNamespaces())) { $this->xml->registerXPathNamespace('ones', $this->xml->getNamespaces()['']); $this->xml->namespace = 'ones'; $this->xml->root = true; } }