Code example for XmlPullParser

Methods: getAttributeCount, getAttributeName, getAttributeValue, nextToken

0
        testMissingEntitiesInAttributesUsingNextToken(parser);
    } 
 
    private void testMissingEntitiesInAttributesUsingNextToken(XmlPullParser parser)
            throws Exception { 
        assertEquals(XmlPullParser.START_TAG, parser.nextToken());
        assertEquals(1, parser.getAttributeCount());
        assertEquals("b", parser.getAttributeName(0));
        assertEquals("Expected unresolved entities to be left in-place. The old parser "
                + "would resolve these to the empty string.", "&aaa;", parser.getAttributeValue(0));
    } 
 
    public void testGreaterThanInText() throws Exception { 
        XmlPullParser parser = newPullParser();
        parser.setInput(new StringReader("<foo>></foo>"));
        assertEquals(XmlPullParser.START_TAG, parser.next());
        assertEquals(XmlPullParser.TEXT, parser.next());
        assertEquals(">", parser.getText());
    } 
 
    public void testGreaterThanInAttribute() throws Exception{