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

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

Description

Read text content of element ith given namespace and name (use null namespace do indicate that nemspace should not be checked)

License

Open Source License

Declaration


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

Method Source Code

//package com.java2s;
// for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/)

import java.io.IOException;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class Main {
    /**//from w ww . j av a  2s.c o m
     * Read text content of element ith given namespace and name
     * (use null namespace do indicate that nemspace should not be checked)
     */

    public static String nextText(XmlPullParser pp, String namespace,
            String name) throws IOException, XmlPullParserException {

        if (name == null) {
            throw new XmlPullParserException(
                    "name for element can not be null");
        }
        pp.require(XmlPullParser.START_TAG, namespace, name);
        return pp.nextText();
    }
}

Related

  1. nextStartTag(XmlPullParser pp, String name)
  2. nextStartTag(XmlPullParser pp, String namespace, String name)
  3. nextStartTag(XmlPullParser pp, String namespace, String name)
  4. nextString(XmlPullParser parser, String tag)
  5. nextText(XmlPullParser pp, String namespace, String name)
  6. safeNext(XmlPullParser parser)
  7. enter(final XmlPullParser pp)
  8. enter(final XmlPullParser pp, final String tagName)