-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
Description
Hi I have to generate an XML without any empty tags.
Right now I use the XmlEncoder to generate it and I have some thing like :
<node>
<subnode>Value</subnode>
<emptysubnode/>
</node>
And what I need in output is :
<node>
<subnode>Value</subnode>
</node>
I can acheive this by changing XmlEncoder buildXml method L396 :
changing this :
} elseif (is_numeric($key) || !$this->isElementNameValid($key)) {
$append = $this->appendNode($parentNode, $data, 'item', $key);
} else {
$append = $this->appendNode($parentNode, $data, $key);
}
to this
} elseif (is_numeric($key) || !$this->isElementNameValid($key)) {
$append = $this->appendNode($parentNode, $data, 'item', $key);
} else {
if ($data !== null) {
$append = $this->appendNode($parentNode, $data, $key);
}
}
Is there a way to do that ? or we can add this feature but I don't really see how to do it ?