hc_elementsetattributenodenullpublic final class hc_elementsetattributenodenull extends org.w3c.domts.DOMTestCase The "setAttributeNode(newAttr)" method returns the
null value if no previously existing Attr node with the
same name was replaced.
Retrieve the last child of the third employee and add a
new attribute to it. The new attribute node added is
"lang", which is not part of this Element. The
method should return the null value.
This test uses the "createAttribute(name)"
method from the Document interface. |
Constructors Summary |
---|
public hc_elementsetattributenodenull(org.w3c.domts.DOMTestDocumentBuilderFactory factory)Constructor.
super(factory);
//
// check if loaded documents are supported for content type
//
String contentType = getContentType();
preload(contentType, "hc_staff", true);
|
Methods Summary |
---|
public java.lang.String | getTargetURI()Gets URI that identifies the test.
return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementsetattributenodenull";
| public static void | main(java.lang.String[] args)Runs this test from the command line.
DOMTestCase.doMain(hc_elementsetattributenodenull.class, args);
| public void | runTest()Runs the test case.
Document doc;
NodeList elementList;
Element testEmployee;
Attr newAttribute;
Attr districtAttr;
doc = (Document) load("hc_staff", true);
elementList = doc.getElementsByTagName("acronym");
testEmployee = (Element) elementList.item(2);
newAttribute = doc.createAttribute("lang");
districtAttr = testEmployee.setAttributeNode(newAttribute);
assertNull("elementSetAttributeNodeNullAssert", districtAttr);
|
|