/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
{ XmlResourceParser parser = getResources().getXml(R.xml.config); parser.next(); int eventType = parser.getEventType(); while (eventType != XmlPullParser.END_DOCUMENT) { if(eventType == XmlPullParser.START_DOCUMENT) { //stringBuffer.append("--- Start XML ---"); } else if(eventType == XmlPullParser.START_TAG) { //stringBuffer.append("\nSTART_TAG: "+xpp.getName()); } else if(eventType == XmlPullParser.END_TAG) { //stringBuffer.append("\nEND_TAG: "+xpp.getName()); } else if(eventType == XmlPullParser.TEXT) { //stringBuffer.append("\nTEXT: "+xpp.getText()); } eventType = parser.next(); } parser.close(); }
URL: http://www.nookl.com