Runs the test case.
Document doc;
Element rootNode;
Node newChild;
NodeList elementList;
Node oldChild;
Node replacedChild;
doc = (Document) load("hc_staff", true);
newChild = doc.createAttribute("lang");
elementList = doc.getElementsByTagName("p");
oldChild = elementList.item(1);
rootNode = (Element) oldChild.getParentNode();
{
boolean success = false;
try {
replacedChild = rootNode.replaceChild(newChild, oldChild);
} catch (DOMException ex) {
success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
}
assertTrue("throw_HIERARCHY_REQUEST_ERR", success);
}