Skip to content

Commit

Permalink
Avoid broken XML-output when no prefix is set (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Sep 15, 2024
1 parent b9b8684 commit 0e52ca8
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() !== null)
($this->getNamespacePrefix() !== '')
? ($this->getNamespacePrefix() . ':' . $this->getAttrName())
: $this->getAttrName(),
$this->getAttrValue(),
Expand Down

0 comments on commit 0e52ca8

Please sign in to comment.