Code example for NodeList

Methods: getLength

        Document doc;
        NodeList newList;
        doc = (Document) load("staffNS", builder);
        newList = doc.getElementsByTagNameNS(namespaceURI, localName);
        // BEGIN android-changed: Was 37, but that assumed validation. 
        assertEquals("throw_Size", 36, newList.getLength());
        // END android-changed 
    public void testGetElementsByTagNameNS2() throws Throwable { 
        Document doc;
        NodeList newList;
        Element newElement;
        String prefix;
        String lname;
        doc = (Document) load("staffNS", builder);
        newList = doc.getElementsByTagNameNS("*", "employee");
        assertEquals("employeeCount", 5, newList.getLength());
        newElement = (Element) newList.item(3);
        prefix = newElement.getPrefix();
        assertEquals("prefix", "emp", prefix);
Connect your IDE to all the code out there  Get Codota for Java