Skip to content

Commit

Permalink
Avoid broken XML-output when no prefix is set (3)
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Sep 15, 2024
1 parent 0e52ca8 commit 31e4b29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 31e4b29

Please sign in to comment.