1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

attribute="0"

This commit is contained in:
Douglas Crockford 2011-02-09 16:49:22 -08:00
parent 80e3312acd
commit dced076cd4

View file

@ -31,7 +31,7 @@ import java.util.Iterator;
* This provides static methods to convert an XML text into a JSONObject, * This provides static methods to convert an XML text into a JSONObject,
* and to covert a JSONObject into an XML text. * and to covert a JSONObject into an XML text.
* @author JSON.org * @author JSON.org
* @version 2011-01-13 * @version 2011-02-11
*/ */
public class XML { public class XML {
@ -313,6 +313,9 @@ public class XML {
if (string.equalsIgnoreCase("null")) { if (string.equalsIgnoreCase("null")) {
return JSONObject.NULL; return JSONObject.NULL;
} }
if (string.equals("0")) {
return new Integer(0);
}
// If it might be a number, try converting it. If that doesn't work, // If it might be a number, try converting it. If that doesn't work,
// return the string. // return the string.