When I convert xml to json, I can use U.xmlToJson(xml, U.Mode.REPLACE_EMPTY_VALUE_WITH_NULL)
but when I convert json to xml, there is no way to replace null value with empty like U.jsonToXml(json, U.Mode.REPLACE_NULL_VALUE_WITH_EMPTY)
This brings some problems, for example, there is a xml content like below
<aaa>
<bbb></bbb>
</aaa>
when I convert it to json
String xml = "<aaa><bbb></bbb></aaa>"
String json = U.xmlToJson(xml, U.Mode.REPLACE_EMPTY_VALUE_WITH_NULL);
When I convert xml to json, I can use
U.xmlToJson(xml, U.Mode.REPLACE_EMPTY_VALUE_WITH_NULL)
but when I convert json to xml, there is no way to replace null value with empty likeU.jsonToXml(json, U.Mode.REPLACE_NULL_VALUE_WITH_EMPTY)
This brings some problems, for example, there is a xml content like belowwhen I convert it to json
the json result is
but, when I convert the json result to xml
the xml result is
But this is not what i want