Android XmlPullParser Move to Next nextElementWithin(XmlPullParser parser, int outerDepth)

Here you can find the source of nextElementWithin(XmlPullParser parser, int outerDepth)

Description

next Element Within

Declaration

public static boolean nextElementWithin(XmlPullParser parser,
            int outerDepth) throws IOException, XmlPullParserException 

Method Source Code

//package com.java2s;
import java.io.IOException;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class Main {
    public static boolean nextElementWithin(XmlPullParser parser,
            int outerDepth) throws IOException, XmlPullParserException {
        for (;;) {
            int type = parser.next();
            if (type == XmlPullParser.END_DOCUMENT
                    || type == XmlPullParser.END_TAG
                    && parser.getDepth() == outerDepth) {
                return false;
            }/*  w  ww. ja  v a  2 s .  co m*/
            if (type == XmlPullParser.START_TAG
                    && parser.getDepth() == outerDepth + 1) {
                return true;
            }
        }
    }
}

Related

  1. nextElement(XmlPullParser parser)
  2. nextElement(XmlPullParser parser)
  3. nextElement(XmlPullParser parser)
  4. nextElement(XmlPullParser parser)
  5. nextElement(XmlPullParser parser)
  6. nextElementWithin(XmlPullParser parser, int outerDepth)
  7. nextElementWithin(XmlPullParser parser, int outerDepth)
  8. nextEndTag(XmlPullParser pp)
  9. nextEndTag(XmlPullParser pp)