Element root = document.createElementNS(null, "root");
root.appendChild(document.createElementNS(null, "child"));
Text node1 = document.createTextNode("test1");
Text node2 = document.createTextNode("test2");
try {
root.replaceChild(node2, node1);
fail("Expected DOMException");
} catch (DOMException ex) {
assertEquals(DOMException.NOT_FOUND_ERR, ex.code);
}
}