while(pp.nextTag() == pp.START_TAG) {
while(pp.nextTag() == XmlPullParser.START_TAG) {
    protected void executeTestParser(XmlPullParser pp) throws IOException, XmlPullParserException    {        pp.require(pp.START_TAG, NS_URI, "test-parser");        String testName = pp.getAttributeValue("", "name");        verbose(">> START TEST '"+testName+"'");        //testFactory = XmlPullParserFactory.newInstance();        XmlPullParserFactory testFactory = factoryNewInstance();        verbose(">> using testFactory='"+testFactory.getClass()+"'");        XmlPullParser testParser = null;        boolean testInputReady = false;        while(pp.nextTag() == pp.START_TAG) {            String action = pp.getName();            if("create-parser".equals(action)) {                testParser = testFactory.newPullParser();                verbose(">> using testParser='"+testParser.getClass()+"'");                pp.nextText();            } else if("input-inline".equals(action)) {                if(testInputReady) {                    throw new RuntimeException("input already set"+pp.getPositionDescription());                }                testInputReady = true;                String input = pp.nextText();                verbose(">>> "+action+" to '"+printable(input)+"'");                verbose(">>> "+action+" to '"+input+"'");                testParser.setInput(new StringReader( input ));            } else if("expect".equals(action)) {                String type = pp.getAttributeValue("", "type");                String namespace = pp.getAttributeValue("", "namespace");                String name = pp.getAttributeValue("", "name");                String empty = pp.getAttributeValue("", "empty");                verbose(">>> "+action                            +" type="+type                            +(namespace != null ? " namespace="+namespace : "")                            +(name != null ? " name="+name : "")                            +(empty != null ? " empty="+empty : ""));                if(type != null) {                    int event = convertToEventType(pp,type);                    // comapring string give better error messages                    assertEquals(pp.TYPES[ event ], pp.TYPES[ testParser.getEventType() ]);                    // now compare actual int values                    assertEquals(event, testParser.getEventType());                }                if(namespace != null) assertEquals(namespace, testParser.getNamespace());                if(name != null) assertEquals(name, testParser.getName());                if(empty != null) {                    boolean isEmpty = Boolean.valueOf( empty ).booleanValue();                    assertEquals(isEmpty, testParser.isEmptyElementTag());                }                pp.nextText();            } else if("next".equals(action)) {                verbose(">>> "+action);                testParser.next();                pp.nextText();            } else if("next-tag".equals(action)) {                verbose(">>> "+action);                testParser.nextTag();                pp.nextText();            } else if("next-text".equals(action)) {                verbose(">>> "+action); //+" on "+testParser.getPositionDescription()+"");                String expected = pp.getAttributeValue("", "text");                String testText = testParser.nextText();                if(expected != null) {                    verbose(">>> "+action+" testParser="+testParser.getPositionDescription()                           +" excpectecd='"+printable(expected)+"' test='"+printable(testText)+"'");                    assertEquals(testParser.getPositionDescription(), printable(expected), printable(testText));                    assertEquals(expected, testText);                }                pp.nextText();            } else if("set-feature".equals(action)) {                String feature = pp.nextText();                verbose(">>> "+action+" "+feature);                testParser.setFeature(feature, true);            } else {                verbose(">>> UNKNONW ACTION '"+action+"' ("+pp.getPositionDescription()+")");                String content = pp.nextText();                if(content.length() > 0) {                    if(verbose) System.err.println(">>> CONTENT='"+printable(content)+"'");                }            }        }        pp.require(pp.END_TAG, NS_URI, "test-parser");        verbose(">> END TEST '"+testName+"'");    }