Code example for Attr

Methods: getNamegetLocalNamegetNamespaceURIgetPrefix

0
        } catch (DOMException e) {
        } 
    } 
 
    public void testRenameAttributeWithNamespace() { 
        document.renameNode(deluxe, "http://sales", "special");
        assertEquals("special", deluxe.getName());
        assertEquals("special", deluxe.getLocalName());
        assertEquals(null, deluxe.getPrefix());
        assertEquals("http://sales", deluxe.getNamespaceURI());
    } 
 
    public void testRenameAttributeWithPrefixAndNamespace() { 
        document.renameNode(deluxe, "http://sales", "a:special");
        assertEquals("a:special", deluxe.getName());
        assertEquals("special", deluxe.getLocalName());
        assertEquals("a", deluxe.getPrefix());
        assertEquals("http://sales", deluxe.getNamespaceURI());
    } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE