private function addAttributes(\DOMElement $node, $properties)
{
$dom = $node instanceof \DOMDocument ? $node : $node->ownerDocument;
foreach ($properties as $name => $value) {
if (!($name === 'xmlns' || substr($name, 0, 6) === 'xmlns:')) {
$namespace = $this->getNamespaceForNode($name, $properties, $node);
$attribute = empty($namespace) ? $dom->createAttribute($name) : $dom->createAttributeNS($namespace, $name);
$attribute->value = $this->getValueAsString($value);
$node->setAttributeNode($attribute);
}
}
}