I'm trying to to convert an xml string to Json in Java. Here is a sample code:
import org.apache.commons.json.utils.XML;
String test = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><a><b>val1</b><d/></a>";
InputStream is = new ByteArrayInputStream(test.getBytes());
String jsonString = XML.toJson(is);
The result is:
{"a":{"b":"val1","d":true}}
I don't understand why d's value is set to true ?
Also is there any way to get this result:
{"a":{"b":"val1","d":""}}