From dced076cd4db0bd86df36c7eb528df5f1543de7e Mon Sep 17 00:00:00 2001 From: Douglas Crockford Date: Wed, 9 Feb 2011 16:49:22 -0800 Subject: [PATCH] attribute="0" --- XML.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/XML.java b/XML.java index cd033e1..e328191 100755 --- a/XML.java +++ b/XML.java @@ -31,7 +31,7 @@ import java.util.Iterator; * This provides static methods to convert an XML text into a JSONObject, * and to covert a JSONObject into an XML text. * @author JSON.org - * @version 2011-01-13 + * @version 2011-02-11 */ public class XML { @@ -313,6 +313,9 @@ public class XML { if (string.equalsIgnoreCase("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, // return the string.