Code example for Document

Methods: renameNode

0
        assertEquals(null, description.getNamespaceURI());
    } 
 
    public void testRenameElementWithPrefix() { 
        try { 
            document.renameNode(description, null, "a:desc");
            fail();
        } catch (DOMException e) {
        } 
    } 
 
    public void testRenameElementWithNamespace() { 
        document.renameNode(description, "http://sales", "desc");
        assertEquals("desc", description.getTagName());
        assertEquals("desc", description.getLocalName());
        assertEquals(null, description.getPrefix());
        assertEquals("http://sales", description.getNamespaceURI());
    } 
 
    public void testRenameElementWithPrefixAndNamespace() { 
        document.renameNode(description, "http://sales", "a:desc");