Thursday, August 8, 2013

xml to json conversion issue in java leading zero discareded

xml to json conversion issue in java leading zero discareded

My xml contains attribute value "0123" after conversion from xml to json
as per following code leading zero gets discarded from attribute value
String xmlval = new
XMLOutputter(Format.getPrettyFormat()).outputString(jdomDocument);
JSONObject xmlJSONObj = XML.toJSONObject(xmlval);
String jsonPrettyPrintString = xmlJSONObj.toString(4);
How to resolve this issue ?

No comments:

Post a Comment