Code example for Document

Methods: getElementsByTagNameNS

0
        String namespaceURI = "*";
        String localName = "*";
        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();