From da0425a01bd7ff2af5814da06043acb7c64f07d7 Mon Sep 17 00:00:00 2001 From: matthiasgrumet Date: Wed, 9 Feb 2011 01:33:41 -0800 Subject: [PATCH] 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 --- XML.java | 3 +++ 1 file changed, 3 insertions(+) mode change 100755 => 100644 XML.java diff --git a/XML.java b/XML.java old mode 100755 new mode 100644 index cd033e1d3..876ec0adc --- a/XML.java +++ b/XML.java @@ -301,6 +301,9 @@ private static boolean parse(XMLTokener x, JSONObject context, * @return A simple JSON value. */ public static Object stringToValue(String string) { + if (string.equals("0")) { + return new Integer(0); + } if (string.equals("")) { return string; }