/** * Moves the parser to the next element. */ public static boolean next(XmlPullParser parser) { assert parser != null; try { if (hasNext(parser)) { parser.next(); return true; } return false; } catch (Exception e) { // EOF exceptions return false; } }
/** * Moves the parser to the next start element. * * @return <code>true</code> if another start element has been found, * <code>false</code> otherwise */ public static boolean findNextStartElemenet(XmlPullParser parser) throws XmlPullParserException, IOException { assert parser != null; while (true) { int event = parser.getEventType(); if (event == XmlPullParser.START_TAG) { return true; } if (hasNext(parser)) { parser.next(); } else { return false; } } }