Android XmlPullParser Move to Next nextStartTag(XmlPullParser pp, String namespace, String name)

Here you can find the source of nextStartTag(XmlPullParser pp, String namespace, String name)

Description

combine nextTag(); pp.require(XmlPullParser.START_TAG, namespace, name);

Declaration

public static void nextStartTag(XmlPullParser pp, String namespace,
        String name) throws XmlPullParserException, IOException 

Method Source Code

//package com.java2s;
import java.io.IOException;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class Main {
    /**/*from w  ww .  j a v a 2s . c  o m*/
     * call parser nextTag() and check that it is START_TAG, throw exception if not.
     */
    public static void nextStartTag(XmlPullParser pp)
            throws XmlPullParserException, IOException {
        if (pp.nextTag() != XmlPullParser.START_TAG) {
            throw new XmlPullParserException("expected START_TAG and not "
                    + pp.getPositionDescription());
        }
    }

    /**
     * combine nextTag(); pp.require(XmlPullParser.START_TAG, null, name);
     */
    public static void nextStartTag(XmlPullParser pp, String name)
            throws XmlPullParserException, IOException {
        pp.nextTag();
        pp.require(XmlPullParser.START_TAG, null, name);
    }

    /**
     * combine nextTag(); pp.require(XmlPullParser.START_TAG, namespace, name);
     */
    public static void nextStartTag(XmlPullParser pp, String namespace,
            String name) throws XmlPullParserException, IOException {
        pp.nextTag();
        pp.require(XmlPullParser.START_TAG, namespace, name);
    }
}

Related

  1. nextLong(XmlPullParser parser, String tag)
  2. nextStartTag(XmlPullParser pp)
  3. nextStartTag(XmlPullParser pp)
  4. nextStartTag(XmlPullParser pp, String name)
  5. nextStartTag(XmlPullParser pp, String name)
  6. nextStartTag(XmlPullParser pp, String namespace, String name)
  7. nextString(XmlPullParser parser, String tag)
  8. nextText(XmlPullParser pp, String namespace, String name)
  9. nextText(XmlPullParser pp, String namespace, String name)