Code example for Document

Methods: renameNode

0
        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());
    } 
 
    public void testUserDataHandlerNotifiedOfRenames() { 
        RecordingHandler handler = new RecordingHandler();
        description.setUserData("a", "apple", handler);
        deluxe.setUserData("b", "banana", handler);
        standard.setUserData("c", "cat", handler);
 
        document.renameNode(deluxe, null, "special");
        document.renameNode(description, null, "desc");