Code example for Attributes

Methods: getLengthgetLocalNamegetQNamegetURI

0
            @Override public void startElement(String uri, String localName,
                    String qName, Attributes attributes) {
                assertEquals("", uri);
                assertEquals("", localName);
                assertEquals("a:foo", qName);
                assertEquals(1, attributes.getLength());
                assertEquals("", attributes.getURI(0));
                assertOneOf("a:bar", "", attributes.getLocalName(0));
                assertEquals("a:bar", attributes.getQName(0));
            } 
        }); 
    } 
 
    /** 
     * Test that the external-general-entities feature can be disabled. 
     * http://code.google.com/p/android/issues/detail?id=9493 
     */ 
    public void testDisableExternalGeneralEntities() throws Exception { 
        String xml = "<!DOCTYPE foo ["
                + "  <!ENTITY bar SYSTEM \"/no-such-document.xml\">"