protected function getNamespaces(\DOMElement $node)
{
$result = $this->getAllNamespaces($node);
$inherited = [];
if ($node->parentNode instanceof \DOMElement) {
$inherited = $this->getAllNamespaces($node->parentNode);
}
return array_diff_assoc($result, $inherited);
}