public class ParseInfo {
private static final String LOG_PV_EVENT = "LogPvEvent";
private static final String STATUS = "Status";
public static boolean ParseInfo(XmlPullParser pullParser,
String namespace) throws XmlPullParserException, IOException {
boolean ret = false;
int eventType = pullParser.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
if (eventType == XmlPullParser.START_TAG
&& LOG_PV_EVENT.equalsIgnoreCase(pullParser.getName())) {
String status = pullParser.getAttributeValue(namespace, STATUS);
if ("ok".equalsIgnoreCase(status)) {
ret = true;
}
}
eventType = pullParser.next();
}
return ret;
}
}
java parse xml file
最新推荐文章于 2024-09-08 10:40:56 发布