Why do I keep getting this message when trying to serialise an XML-string to JSON-string, when using Json-Lib.
Here is the code:
String jsonString = "<o><bool type=\"boolean\">true</bool>" +
"<int type=\"number\">1</int>" +
"<name type=\"string\">json</name></o>";
XMLSerializer xml = new XMLSerializer();
JSONObject jobject = (JSONObject) xml.read(jsonString);
System.out.println(jobject.toString(2));
Output is:
Sep 19, 2011 4:03:46 PM net.sf.json.xml.XMLSerializer getType
INFO: Using default type string
{
"bool": true,
"int": 1,
"name": "json"
}
Why do I get this “INFO: Using default...” message? And, how can I get rid of it?
You are getting that message because your top level element o does not have a type. It’s just an INFO message, so you can ignore it. If you changed:
to:
It should go away. But, it also shouldn’t matter.