Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

nodereplacechild Class Reference

Inherits DOMTestCase.

List of all members.

Public Methods

 nodereplacechild (DOMTestDocumentBuilderFactory factory)
void runTest () throws java.lang.Throwable
String getTargetURI ()

Static Public Methods

void main (String[] args)


Detailed Description

The "replaceChild(newChild,oldChild)" method replaces the node "oldChild" with the node "newChild".

Replace the first element of the second employee with a newly created Element node. Check the first position after the replacement operation is completed. The new Element should be "newChild".

Author:
NIST , Mary Brady
See also:
http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307

Definition at line 45 of file nodereplacechild.java.


Constructor & Destructor Documentation

nodereplacechild::nodereplacechild DOMTestDocumentBuilderFactory    factory [inline]
 

Definition at line 47 of file nodereplacechild.java.

00048  {
00049       super(factory);
00050 
00051    }


Member Function Documentation

String nodereplacechild::getTargetURI   [inline, virtual]
 

Reimplemented from DOMTest.

Definition at line 75 of file nodereplacechild.java.

00075                                 {
00076       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechild";
00077    }

void nodereplacechild::main String    args[] [inline, static]
 

Definition at line 78 of file nodereplacechild.java.

References DOMTestCase::doMain().

00078                                           {
00079         DOMTestCase.doMain(nodereplacechild.class,args);
00080    }

void nodereplacechild::runTest   [inline, virtual]
 

Reimplemented from DOMTestCase.

Definition at line 53 of file nodereplacechild.java.

References DOMTestCase::assertEquals(), and DOMTest::load().

00053                                                     {
00054       Document doc;
00055       NodeList elementList;
00056       Node employeeNode;
00057       NodeList childList;
00058       Node oldChild;
00059       Node newChild;
00060       Node child;
00061       String childName;
00062       Node replacedNode;
00063       doc = load("staff");
00064       elementList = doc.getElementsByTagName("employee");
00065       employeeNode = elementList.item(1);
00066       childList = employeeNode.getChildNodes();
00067       oldChild = childList.item(0);
00068       newChild = doc.createElement("newChild");
00069       replacedNode = employeeNode.replaceChild(newChild,oldChild);
00070       child = childList.item(0);
00071       childName = child.getNodeName();
00072       assertEquals("nodeReplaceChildAssert1","newChild",childName);
00073       
00074    }


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 19:47:08 2002 for DOM Level 1 Core Test Suite by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001