Code example for Document

Methods: getDocumentElement

0
    public void testGetElementsByTagNameNS8() throws Throwable { 
        Document doc;
        Element docElem;
        NodeList newList;
        doc = (Document) load("staffNS", builder);
        docElem = doc.getDocumentElement();
        newList = docElem.getElementsByTagNameNS("*", "*");
        assertEquals("listSize", 35, newList.getLength());
    } 
    public void testGetElementsByTagNameNS9() throws Throwable { 
        Document doc;
        NodeList newList;
        Element newElement;
        String prefix;
        String lname;
        Element docElem;
        doc = (Document) load("staffNS", builder);
        docElem = doc.getDocumentElement();
        newList = docElem.getElementsByTagNameNS("*", "employee");
        assertEquals("employeeCount", 5, newList.getLength());
        newElement = (Element) newList.item(3);