entRefImp2 = (EntityReference) doc.importNode(entRef2, true); entRefImp3 = (EntityReference) doc.importNode(entRef3, false); nodes = entRefImp2.getChildNodes(); nodeImp2 = nodes.item(0); nodeValueImp2 = nodeImp2.getNodeValue(); nodes = entRefImp3.getChildNodes(); nodeImp3 = nodes.item(0); nodeValueImp3 = nodeImp3.getNodeValue();
newChild = attribute.appendChild(entRef); newAttribute = element.setAttributeNodeNS(attribute); elementList = entRef.getChildNodes(); element = (Element) elementList.item(0); attribute2 = doc.createAttributeNS("http://www.w3.org/DOM/Test", "attr2");
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; EntityReference newEntRefNode; NodeList newEntRefList; Node child; String name; String value; doc = (Document) load("staff", true); newEntRefNode = doc.createEntityReference("ent3"); assertNotNull("createdEntRefNotNull", newEntRefNode); newEntRefList = newEntRefNode.getChildNodes(); assertSize("size", 1, newEntRefList); child = newEntRefNode.getFirstChild(); name = child.getNodeName(); assertEquals("name", "#text", name); value = child.getNodeValue(); assertEquals("value", "Texas", value); } /**