开发者

Parsing the XML Response in an Android Application

开发者 https://www.devze.com 2023-01-16 05:31 出处:网络
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.

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 li开发者_如何学JAVAnk will be OK. Thanks, david


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消