public void require( int type, String namespace, String name ) throws XmlPullParserException, IOException { if ( processNamespaces == false && namespace != null ) { throw new XmlPullParserException( "processing namespaces must be enabled on parser (or factory)" + " to have possible namespaces declared on elements" + ( " (position:" + getPositionDescription() ) + ")" ); } if ( type != getEventType() || ( namespace != null && !namespace.equals( getNamespace() ) ) || ( name != null && !name.equals( getName() ) ) ) { throw new XmlPullParserException( "expected event " + TYPES[type] + ( name != null ? " with name '" + name + "'" : "" ) + ( namespace != null && name != null ? " and" : "" ) + ( namespace != null ? " with namespace '" + namespace + "'" : "" ) + " but got" + ( type != getEventType() ? " " + TYPES[getEventType()] : "" ) + ( name != null && getName() != null && !name.equals( getName() ) ? " name '" + getName() + "'" : "" ) + ( namespace != null && name != null && getName() != null && !name.equals( getName() ) && getNamespace() != null && !namespace.equals( getNamespace() ) ? " and" : "" ) + ( namespace != null && getNamespace() != null && !namespace.equals( getNamespace() ) ? " namespace '" + getNamespace() + "'" : "" ) + ( " (position:" + getPositionDescription() ) + ")" ); } }
public int nextTag() throws XmlPullParserException, IOException { next(); if ( eventType == TEXT && isWhitespace() ) { // skip whitespace next(); } if ( eventType != START_TAG && eventType != END_TAG ) { throw new XmlPullParserException( "expected START_TAG or END_TAG not " + TYPES[getEventType()], this, null ); } return eventType; }
if ( getEventType() != START_TAG ) + TYPES[getEventType()], this, null );
+(" (postion:"+ getPositionDescription())+")"); if (type != getEventType() || (namespace != null && !namespace.equals (getNamespace())) || (name != null && !name.equals (getName ())) ) +(namespace != null ? " with namespace '"+namespace+"'" : "") +" but got" +(type != getEventType() ? " "+TYPES[ getEventType() ] : "") +(name != null && getName() != null && !name.equals (getName ()) ? " name '"+getName()+"'" : "")
public int nextTag() throws XmlPullParserException, IOException { next(); if(eventType == TEXT && isWhitespace()) { // skip whitespace next(); } if (eventType != START_TAG && eventType != END_TAG) { throw new XmlPullParserException("expected START_TAG or END_TAG not " +TYPES[ getEventType() ], this, null); } return eventType; }
if(getEventType() != START_TAG) { throw new XmlPullParserException( "parser must be on START_TAG to read next text", this, null); throw new XmlPullParserException( "TEXT must be immediately followed by END_TAG and not " +TYPES[ getEventType() ], this, null);
while ( parser.getEventType() == XmlPullParser.START_TAG ) while ( parser.getEventType() == XmlPullParser.START_TAG )