Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

nodecloneattributescopied Class Reference

Inherits DOMTestCase.

List of all members.

Public Methods

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

Static Public Methods

void main (String[] args)


Detailed Description

If the "cloneNode(deep)" method was used to clone an Element node, all the attributes of the Element are copied along with their values.

Retrieve the last child of the second employee and inoke the "cloneNode(deep)" method with deep=true. The duplicate node returned by the method should copy the attributes associated with this node.

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

Definition at line 46 of file nodecloneattributescopied.java.


Constructor & Destructor Documentation

nodecloneattributescopied::nodecloneattributescopied DOMTestDocumentBuilderFactory    factory [inline]
 

Definition at line 48 of file nodecloneattributescopied.java.

00049  {
00050       super(factory);
00051 
00052    }


Member Function Documentation

String nodecloneattributescopied::getTargetURI   [inline, virtual]
 

Reimplemented from DOMTest.

Definition at line 82 of file nodecloneattributescopied.java.

00082                                 {
00083       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecloneattributescopied";
00084    }

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

Definition at line 85 of file nodecloneattributescopied.java.

References DOMTestCase::doMain().

00085                                           {
00086         DOMTestCase.doMain(nodecloneattributescopied.class,args);
00087    }

void nodecloneattributescopied::runTest   [inline, virtual]
 

Reimplemented from DOMTestCase.

Definition at line 54 of file nodecloneattributescopied.java.

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

00054                                                     {
00055       Document doc;
00056       NodeList elementList;
00057       Node addressNode;
00058       Node clonedNode;
00059       NamedNodeMap attributes;
00060       Node attributeNode;
00061       String attributeName;
00062       Collection result = new ArrayList();
00063       
00064       Collection expectedResult = new ArrayList();
00065       expectedResult.add("domestic");
00066       expectedResult.add("street");
00067       
00068       doc = load("staff");
00069       elementList = doc.getElementsByTagName("address");
00070       addressNode = elementList.item(1);
00071       clonedNode = addressNode.cloneNode(false);
00072       attributes = clonedNode.getAttributes();
00073       for(int _index = 0; _index < attributes.getLength();_index++) {
00074       attributeNode = ( Node ) attributes.item(_index);
00075            attributeName = attributeNode.getNodeName();
00076       result.add(attributeName);
00077       
00078         }
00079       assertEquals("nodeCloneAttributesCopiedAssert1",expectedResult,result);
00080       
00081    }


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