Closed sezal closed 5 years ago
In XML::Simple its own logic and it is not always correct in all cases, for example:
$ perl -e "use XML::Simple;print XMLout({'' => 'x'})"
<opt ="x" />
$ perl -e "use XML::Simple;print XMLout({'' => ['x', 'y']}, NoAttr => 1)"
<opt>
<>x</>
<>y</>
</opt>
I think it's better to replace empty tags with a line like "_" or something else customizable, for example:
<opt "_"="x" />
<opt>
<_>x</_>
<_>y</_>
</opt>
I see. You probably right. Any solution that results in valid XML is already step forward. Btw, attribute name in you example probably should be unquoted.
outdated
Serialization of hash with empty keys produces invalid XML. Consider switching to XML::Simple's approach, because it safer (produces valid XML).