handaling of empty string in json to xml to json conversion
I am using staxon to convert json to xml and then same xml to json i.e. json <-->xml<-->json
while doing so when I am giving following json
{ "emptyKey" : "", "nullKey" :null }
which is getting converted into this xml with virtual root
"<root-Element><emptyKey></emptyKey><nullKey></nullKey></root-Element>"
now when I convert this xml back to JSON I am getting json
{ "emptyKey" : null, "nullKey" : null }
basically empty string is converted into null, Is there any way to handle empty string properly.
There is currently no way to handle this, i.e. there is no null in XML. There is a pull request to support the xsi:nil attribute, see https://github.com/beckchr/staxon/pull/27. However, this needs some more investigation.