getNamespaces() protected method

If compares the namespaces of the current node with the ones from the parent node. Only definitions that are different are returned.
protected getNamespaces ( DOMElement $node ) : array
$node DOMElement
return array
Esempio n. 1
0
 protected function getNamespaces(\DOMElement $node)
 {
     $result = [];
     foreach (parent::getNamespaces($node) as $prefix => $uri) {
         $attribute = new \stdClass();
         $attribute->{'#name'} = '@' . $prefix;
         $attribute->{'#text'} = $uri;
         $attribute->{'#children'} = [];
         $result[] = $attribute;
     }
     return $result;
 }