Code example for Document

Methods: getElementsByTagNameNS

        Attr attr;
        Attr attrImp;
        NodeList addresses;
        doc = (Document) load("staffNS", builder);
        docImp = (Document) load("staff", builder);
        addresses = doc
                .getElementsByTagNameNS("", "address");
        element = (Element) addresses.item(1);
        assertNotNull("empAddressNotNull", element);
        attr = element.getAttributeNodeNS("", "zone");
        attrImp = (Attr) docImp.importNode(attr, true);
        ownerElement = attrImp.getOwnerElement();
        assertNull("attrgetownerelement04", ownerElement);
        level = TestLevel.PARTIAL, 
        notes = "Doesn't verify that getOwnerElement returns null if an attribute is not in use.", 
        method = "getOwnerElement", 
Experience pair programming with AI  Get Codota for Java