Having trouble reading XML file from Windows server. Works on Linux

Posted by DuFF14 on Stack Overflow See other posts from Stack Overflow or by DuFF14
Published on 2012-09-12T15:36:58Z Indexed on 2012/09/12 15:37 UTC
Read the original article Hit count: 212

Filed under:
|
|
|
|

I'm parsing an XML file in an android app. My success varies depending upon where the file is hosted. After hosting the file on 4 different servers (2 Linux, 2 Windows), I discovered that when the xml is hosted on a Linux server, the app works. When it's hosted on a Windows server, I am unable to parse correctly. Instead of reading the expected xml tags, it reads HTML tags (, , , etc). I'm not sure why it doesn't work on Windows servers, or if that is even the issue and not just a coincidence. Any help is appreciated.
Thanks.

Here is my code:

private void getXmlData() {
        HttpClient httpclient = new DefaultHttpClient();    
        String url = XML_URL;
        HttpPost httppost = new HttpPost(url);
        HttpResponse response = httpclient.execute(httppost);
        SaxParser saxParser = new SaxParser(response);
        parsedXML = saxParser.parse();
}

© Stack Overflow or respective owner

Related posts about android

Related posts about Xml