Skip Menu |

This queue is for tickets about the XML-XML2JSON CPAN distribution.

Report information
The Basics
Id: 66311
Status: resolved
Priority: 0/
Queue: XML-XML2JSON

People
Owner: Nobody in particular
Requestors: mutant.nz [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.05
Fixed in: (no value)



Subject: '0' not handled correctly in converting JSON to XML
The JSON structure: { "foo": { "bar": 0 } } Is converted to this XML: <foo bar=""/> However, it should be: <foo bar="0"/> This appears to be due to these lines in _process_element_hash(): my $Value = $Obj->{$Key} || q{}; These should be changed to: my $Value = $Obj->{$Key} // q{}; (Or something more convoluted if you want to support something before perl 5.10).
The same is true for the reverse conversion, XML to JSON. That is, <foo>0</foo> is represented as: "foo":{}
Just to add: the offending line for my example is this one, in _process_children: $ElementHash->{ $Self->{content_key} } = $Text if $Text;
This is fixed in 0.06