I am trying to parse an xml file online, but there seems to be something wrong with the way the data is displayed on the website on which I am trying to get it.
This is my method to return a website string;
public String getXmlFromUrl(String url) {
String xml = null;
try {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
xml = EntityUtils.toString(httpEntity);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return xml;
}
When I debug the code, the line xmlfor the requested link returns this;

The link in the image above is a link, so I saved the data from this site to my own XML file and downloaded it here and if I used this link it would work fine, but using the "cloud" link in my picture, it returns these weird characters, does anyone know why?
source
share