Code example for XmlPullParserFactory

Methods: setNamespaceAware

0
        try { 
            factory = XmlPullParserFactory.newInstance();
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } 
        factory.setNamespaceAware(true);
    } 
     
 
     
    private String getText() throws XmlPullParserException, IOException {
        if (eventType != XmlPullParser.START_TAG) {
            eventType = xpp.next();
            return "UnKnown"; 
        } 
         
        while (eventType != XmlPullParser.TEXT) {
            eventType = xpp.next();
        } 
         
        return xpp.getText();