Skip to content

Commit

Permalink
attribute="0"
Browse files Browse the repository at this point in the history
  • Loading branch information
douglascrockford committed Feb 10, 2011
1 parent 80e3312 commit dced076
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion XML.java
Expand Up @@ -31,7 +31,7 @@ of this software and associated documentation files (the "Software"), to deal
* 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 {

Expand Down Expand Up @@ -313,6 +313,9 @@ public static Object stringToValue(String string) {
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.
Expand Down

0 comments on commit dced076

Please sign in to comment.