0

I am POSTing to a PHP file from my website. I am not using JSON, so when I try to use code like Log.e("errr", jsonObj.getString("err")); I get a system.err saying:

07-27 20:57:29.274: W/System.err(2431): org.json.JSONException: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject

Is there a method like JSONObject that I can use to parse/get the given string that I want to get?

David
  • 3,831
  • 2
  • 28
  • 38
Christian
  • 958
  • 5
  • 23
  • 52
  • Hmmmmm.... this doesn't make much sense. You can't parse JSON out of an XML-like input. – dmon Jul 28 '12 at 03:28
  • @dmon, i got that. but is there a method like json for xml file? – Christian Jul 28 '12 at 03:31
  • Depending on the complexity of the XML, there's some methods that work better than others. You might want begin by taking a look at using [SAXParser](http://www.mkyong.com/java/how-to-read-xml-file-in-java-sax-parser/). – dmon Jul 28 '12 at 03:33
  • @dmon, that doesnt look like it will look for me. I am using php with doctype. i mean i dont know much about php and this so if i am just seeing it wrong can you help me out? – Christian Jul 29 '12 at 00:24

1 Answers1

0

It was easier just to restructure my php so that I could call json.

Christian
  • 958
  • 5
  • 23
  • 52