@Override public OccupantsInfo parse(XmlPullParser parser, int initialDepth) throws XmlPullParserException, IOException, SmackException { OccupantsInfo occupantsInfo = new OccupantsInfo(parser.getAttributeValue("", "roomID")); boolean done = false; while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG && "occupant".equals(parser.getName())) { occupantsInfo.occupants.add(parseOccupantInfo(parser)); } else if (eventType == XmlPullParser.END_TAG && ELEMENT_NAME.equals(parser.getName())) { done = true; } } return occupantsInfo; }
public IQ parseIQ(XmlPullParser parser) throws Exception { if (parser.getEventType() != XmlPullParser.START_TAG) { throw new IllegalStateException("Parser not in proper position, or bad XML."); } OccupantsInfo occupantsInfo = new OccupantsInfo(parser.getAttributeValue("", "roomID")); boolean done = false; while (!done) { int eventType = parser.next(); if ((eventType == XmlPullParser.START_TAG) && ("occupant".equals(parser.getName()))) { occupantsInfo.occupants.add(parseOccupantInfo(parser)); } else if (eventType == XmlPullParser.END_TAG && ELEMENT_NAME.equals(parser.getName())) { done = true; } } return occupantsInfo; }
public IQ parseIQ(XmlPullParser parser) throws Exception { if (parser.getEventType() != XmlPullParser.START_TAG) { throw new IllegalStateException("Parser not in proper position, or bad XML."); } OccupantsInfo occupantsInfo = new OccupantsInfo(parser.getAttributeValue("", "roomID")); boolean done = false; while (!done) { int eventType = parser.next(); if ((eventType == XmlPullParser.START_TAG) && ("occupant".equals(parser.getName()))) { occupantsInfo.occupants.add(parseOccupantInfo(parser)); } else if (eventType == XmlPullParser.END_TAG && ELEMENT_NAME.equals(parser.getName())) { done = true; } } return occupantsInfo; }
public IQ parseIQ(XmlPullParser parser) throws Exception { if (parser.getEventType() != XmlPullParser.START_TAG) { throw new IllegalStateException("Parser not in proper position, or bad XML."); } OccupantsInfo occupantsInfo = new OccupantsInfo(parser.getAttributeValue("", "roomID")); boolean done = false; while (!done) { int eventType = parser.next(); if ((eventType == XmlPullParser.START_TAG) && ("occupant".equals(parser.getName()))) { occupantsInfo.occupants.add(parseOccupantInfo(parser)); } else if (eventType == XmlPullParser.END_TAG && ELEMENT_NAME.equals(parser.getName())) { done = true; } } return occupantsInfo; }