hc_nodechildnodesemptypublic final class hc_nodechildnodesempty extends org.w3c.domts.DOMTestCase The "getChildNodes()" method returns a NodeList
that contains all children of this node. If there
are not any children, this is a NodeList that does not
contain any nodes.
Retrieve the character data of the second "em" node and
invoke the "getChildNodes()" method. The
NodeList returned should not have any nodes. |
Constructors Summary |
---|
public hc_nodechildnodesempty(org.w3c.domts.DOMTestDocumentBuilderFactory factory)Constructor.
super(factory);
//
// check if loaded documents are supported for content type
//
String contentType = getContentType();
preload(contentType, "hc_staff", false);
|
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_nodechildnodesempty";
| public static void | main(java.lang.String[] args)Runs this test from the command line.
DOMTestCase.doMain(hc_nodechildnodesempty.class, args);
| public void | runTest()Runs the test case.
Document doc;
NodeList elementList;
NodeList childList;
Node employeeNode;
Node textNode;
int length;
doc = (Document) load("hc_staff", false);
elementList = doc.getElementsByTagName("em");
employeeNode = elementList.item(1);
textNode = employeeNode.getFirstChild();
childList = textNode.getChildNodes();
length = (int) childList.getLength();
assertEquals("length_zero", 0, length);
|
|