diff --git a/src/Attribute.php b/src/Attribute.php index 84f13c0..e8d2415 100644 --- a/src/Attribute.php +++ b/src/Attribute.php @@ -108,7 +108,7 @@ public function toXML(DOMElement $parent): DOMElement { $parent->setAttributeNS( $this->getNamespaceURI(), - ($this->getNamespacePrefix() !== '') + in_array($this->getNamespacePrefix(), ['', null]) ? ($this->getNamespacePrefix() . ':' . $this->getAttrName()) : $this->getAttrName(), $this->getAttrValue(),