Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

elementaddnewattribute Class Reference

Inherits DOMTestCase.

List of all members.

Public Methods

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

Static Public Methods

void main (String[] args)


Detailed Description

The "setAttribute(name,value)" method adds a new attribute to the Element

Retrieve the last child of the last employee, then add an attribute to it by invoking the "setAttribute(name,value)" method. It should create a "name" attribute with an assigned value equal to "value".

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

Definition at line 46 of file elementaddnewattribute.java.


Constructor & Destructor Documentation

elementaddnewattribute::elementaddnewattribute DOMTestDocumentBuilderFactory    factory [inline]
 

Definition at line 48 of file elementaddnewattribute.java.

00049  {
00050       super(factory);
00051 
00052    }


Member Function Documentation

String elementaddnewattribute::getTargetURI   [inline, virtual]
 

Reimplemented from DOMTest.

Definition at line 67 of file elementaddnewattribute.java.

00067                                 {
00068       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementaddnewattribute";
00069    }

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

Definition at line 70 of file elementaddnewattribute.java.

References DOMTestCase::doMain().

00070                                           {
00071         DOMTestCase.doMain(elementaddnewattribute.class,args);
00072    }

void elementaddnewattribute::runTest   [inline, virtual]
 

Reimplemented from DOMTestCase.

Definition at line 54 of file elementaddnewattribute.java.

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

00054                                                     {
00055       Document doc;
00056       NodeList elementList;
00057       Element testEmployee;
00058       String attrValue;
00059       doc = load("staff");
00060       elementList = doc.getElementsByTagName("address");
00061       testEmployee = (Element)elementList.item(4);
00062       testEmployee.setAttribute("district","dallas");
00063       attrValue = testEmployee.getAttribute("district");
00064       assertEquals("elementAddNewAttributeAssert","dallas",attrValue);
00065       
00066    }


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