Android XmlPullParser Search beginDocument(XmlPullParser parser, String firstElementName)

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

Description

begin Document

Declaration

@SuppressWarnings("static-access")
    public static final void beginDocument(XmlPullParser parser,
            String firstElementName) throws XmlPullParserException,
            IOException 

Method Source Code

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

public class Main {
    @SuppressWarnings("static-access")
    public static final void beginDocument(XmlPullParser parser,
            String firstElementName) throws XmlPullParserException,
            IOException {//  w w w  .  j  a v  a2  s.co  m
        int type;
        while ((type = parser.next()) != parser.START_TAG
                && type != parser.END_DOCUMENT) {
            ;
        }

        if (type != parser.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. beginDocument(XmlPullParser parser, String firstElementName)
  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. matchNameSpaceUri( XmlPullParser paramXmlPullParser, String paramString)
  7. matches(XmlPullParser pp, int type, String namespace, String name)
  8. matches(XmlPullParser pp, int type, String namespace, String name)
  9. test(final XmlPullParser pp, final String tagName)