views:

57

answers:

2

Hi all!

I want to Parse the XML Response in my Application using a SAX PArser, I don't know how to do that, So Can anybody please giude me to the right path.

An example with a little coding or a link will be OK. Thanks, david

A: 
try {
        HttpClient client = new DefaultHttpClient();
        String getURL = <URL>;
        HttpGet get = new HttpGet(getURL);
        HttpResponse responseGet = client.execute(get);
         mResEntityGet = responseGet.getEntity();
        if (mResEntityGet != null) {
            //do something with the response
            content = EntityUtils.toString(mResEntityGet);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

"content" will be the string of XML format, parse it using XML pull parser.

Kantesh