1

This is my error:

--> E/XML error(989): Error: expected: /link read: head (position:END_TAG @49:8 in java.io.InputStreamReader@537f609c)

I am reading a xml - file with ISO 8859-1 encoding.

But it's impossible. In other encodings if that is posible, for example UTF -8 , ISO- 8859-15, but not with ISO 8859-1.

URL url = new URL(MYLINK)

InputStream mi;
HttpURLConnection connection = (HttpURLConnection) url
    .openConnection();
    connection.setReadTimeout(10 * 1000);
    connection.setConnectTimeout(10 * 1000);
    connection.setRequestMethod("GET");
        connection.setDoInput(true);
    connection.connect();
int response = connection.getResponseCode();
Log.d("debug", "The response is: " + response);
mi = connection.getInputStream();
XmlPullParser xpp = factory.newPullParser();
xpp.setInput(mi, "ISO-8859-1");

....

2
  • possible duplicate of Exception while parsing xml in android Commented Sep 18, 2014 at 9:12
  • bishan my XML file is correct. Is a rss font from a web page very important. Commented Sep 18, 2014 at 9:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.