Android XmlPullParser Search MoveToContent(XmlPullParser parser)

Here you can find the source of MoveToContent(XmlPullParser parser)

Description

Move To Content

License

Open Source License

Declaration

public static int MoveToContent(XmlPullParser parser)
            throws XmlPullParserException, IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static int MoveToContent(XmlPullParser parser)
            throws XmlPullParserException, IOException {
        if (parser == null)
            throw new NullPointerException();
        while (parser.getEventType() == XmlPullParser.PROCESSING_INSTRUCTION
                || parser.getEventType() == XmlPullParser.DOCDECL
                || parser.getEventType() == XmlPullParser.IGNORABLE_WHITESPACE
                || parser.getEventType() == XmlPullParser.START_DOCUMENT) {
            if (!Read(parser)) {
                break;
            }/*from w ww .j  a  va 2  s .co  m*/
        }
        return parser.getEventType();
    }

    public static boolean Read(XmlPullParser parser)
            throws XmlPullParserException, IOException {
        if (parser == null)
            throw new NullPointerException();
        if (parser.getEventType() == XmlPullParser.END_DOCUMENT)
            return false;
        parser.nextToken();
        return true;
    }
}

Related

  1. beginDocument(XmlPullParser parser, String firstElementName)
  2. beginDocument(XmlPullParser parser, String firstElementName)
  3. beginDocument(XmlPullParser parser, String firstElementName)
  4. beginDocument(XmlPullParser parser, String firstElementName)