So I think I was questioning the wrong way in previous threads. I better put it like this. I\'m trying to parse the XML data:
![CDA
I guess it's something about encoding. Maybe your parser doesn't like the exclamation mark (!). Can you make sure that you use the XML file with the correct encoding? (UTF-8)
Otherwise, you have this problem: KXmlParser throws "Unexpected token" exception at the start of RSS pasing.
I googled around and it looks like the easiest fix is here. You can try adding this method. (From the tutorial you use, put this in the ImageLoader class.)
import java.io.PushbackInputStream;
private InputStream checkForUtf8BOMAndDiscardIfAny(InputStream inputStream) throws IOException {
PushbackInputStream pushbackInputStream = new PushbackInputStream(new BufferedInputStream(inputStream), 3);
byte[] bom = new byte[3];
if (pushbackInputStream.read(bom) != -1) {
if (!(bom[0] == (byte) 0xEF && bom[1] == (byte) 0xBB && bom[2] == (byte) 0xBF)) {
pushbackInputStream.unread(bom);
}
}
return pushbackInputStream; }
Then you can do
InputStream is=conn.getInputStream();
is = checkForUtf8BOMAndDiscardIfAny(is);
I don't have a chance to test the method but it should do it. Also, please see Byte order mark screws up file reading in Java.