Android XmlPullParser Search beginDocument(XmlPullParser parser, String firstElementName)

Here you can find the source of beginDocument(XmlPullParser parser, String firstElementName)

Description

begin Document

Declaration

public static final void beginDocument(XmlPullParser parser,
            String firstElementName) 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 {
    public static final void beginDocument(XmlPullParser parser,
            String firstElementName) throws XmlPullParserException,
            IOException {/*from   w ww.  j  a v  a  2s .  com*/
        int type;
        while ((type = parser.next()) != XmlPullParser.START_TAG
                && type != XmlPullParser.END_DOCUMENT) {
            ;
        }

        if (type != XmlPullParser.START_TAG) {
            throw new XmlPullParserException("No start tag found");
        }

        if (!parser.getName().equals(firstElementName)) {
            throw new XmlPullParserException("Unexpected start tag: found "
                    + parser.getName() + ", expected " + firstElementName);
        }
    }
}

Related

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