X Tutup
Skip to content

Commit da0425a

Browse files
committed
fixed the error when an attribute is 0, the result will be a string containing the character 0 instead of the number 0.
discussion here: http://stackoverflow.com/questions/4933322/json-org-zeros-are-saved-as-strings-and-not-as-numbers
1 parent ef5893a commit da0425a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

XML.java

100755100644
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ private static boolean parse(XMLTokener x, JSONObject context,
301301
* @return A simple JSON value.
302302
*/
303303
public static Object stringToValue(String string) {
304+
if (string.equals("0")) {
305+
return new Integer(0);
306+
}
304307
if (string.equals("")) {
305308
return string;
306309
}

0 commit comments

Comments
 (0)
X Tutup