Code example for XmlPullParser

Methods: getText, next, nextTag, require

0
                IOException; 
 
        // Processes text tags in the response. 
        protected String readTextTag(XmlPullParser parser, String tag) throws IOException,
                XmlPullParserException { 
            parser.require(XmlPullParser.START_TAG, ns, tag);
            String text = readText(parser);
            parser.require(XmlPullParser.END_TAG, ns, tag);
            return text;
        } 
 
        // For text tags, extracts their text values. 
        protected String readText(XmlPullParser parser) throws IOException, XmlPullParserException {
            String result = "";
            if (parser.next() == XmlPullParser.TEXT) {
                result = parser.getText();
                parser.nextTag();
            } 
            return result;
        } 
 
        /*