Code example for XmlPullParser

Methods: getName, getText, next, nextToken, setInput

0
        assertEquals("a", parser.getName());
    } 
 
    public void testRegularNumericEntities() throws Exception { 
        XmlPullParser parser = newPullParser();
        parser.setInput(new StringReader("<foo>&#65;</foo>"));
        assertEquals(XmlPullParser.START_TAG, parser.next());
        assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken());
        assertEquals("#65", parser.getName());
        assertEquals("A", parser.getText());
    } 
 
    public void testNumericEntitiesLargerThanChar() throws Exception { 
        assertParseFailure("<foo>&#2147483647; &#-2147483648;</foo>"); 
    } 
 
    public void testNumericEntitiesLargerThanInt() throws Exception { 
        assertParseFailure("<foo>&#2147483648;</foo>"); 
    } 
 
    public void testCharacterReferenceOfHexUtf16Surrogates() throws Exception {