private function addNamespaceAttributes(ClassMetadata $metadata, \DOMElement $element): void
    {
        foreach ($metadata->xmlNamespaces as $prefix => $uri) {
            $attribute = 'xmlns';
            if ('' !== $prefix) {
                $attribute .= ':' . $prefix;
            } elseif ($element->namespaceURI === $uri) {
                continue;
            }
            $element->setAttributeNS('http://www.w3.org/2000/xmlns/', $attribute, $uri);
        }
    }
private function addNamespaceAttributes(ClassMetadata $metadata, \DOMElement $element): void
    {
        foreach ($metadata->xmlNamespaces as $prefix => $uri) {
            $attribute = 'xmlns';
            if ('' !== $prefix) {
                $attribute .= ':' . $prefix;
            } elseif ($element->namespaceURI === $uri) {
                continue;
            }
            $element->setAttributeNS('http://www.w3.org/2000/xmlns/', $attribute, $uri);
        }
    }
private function addNamespaceAttributes ( ClassMetadata $ metadata , \ DOMElement $ element ) : void { foreach ( $ metadata -> xmlNamespaces as $ prefix => $ uri ) { $ attribute = 'xmlns' ; if ( '' !== $ prefix ) { $ attribute .= ':' . $ prefix ; } elseif ( $ element -> namespaceURI === $ uri ) { continue ; } $ element -> setAttributeNS ( 'http://www.w3.org/2000/xmlns/' , $ attribute , $ uri ) ; } }
Adds namespace attributes to the XML root element
Adds namespace attributes to the XML root element