Main Page Packages Class Hierarchy Compound List File List Compound Members

# namednodemapsetnameditemreturnvalue Class Reference

Inherits DOMTestCase.

List of all members.

## Public Methods
| namednodemapsetnameditemreturnvalue (DOMTestDocumentBuilderFactory factory)
void | runTest () throws java.lang.Throwable
String | getTargetURI ()
## Static Public Methods
void | main (String[] args)

## Detailed Description

If the "setNamedItem(arg)" method replaces an already existing node with the same name then the already existing node is returned.

Retrieve the third employee and create a NamedNodeMap object from the attributes of the last child by invoking the "getAttributes()" method. Once the list is created an invocation of the "setNamedItem(arg)" method is done with arg=newAttr, where newAttr is a new Attr Node previously created and whose node name already exists in the map. The "setNamedItem(arg)" method should replace the already existing node with the new one and return the existing node. This test uses the "createAttribute(name)" method from the document interface.

Author:
  NIST , Mary Brady

See also:
  http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9

Definition at line 54 of file namednodemapsetnameditemreturnvalue.java.

## Constructor & Destructor Documentation

namednodemapsetnameditemreturnvalue::namednodemapsetnameditemreturnvalue | ( | DOMTestDocumentBuilderFactory | factory | ) | `[inline]`

| Definition at line 56 of file namednodemapsetnameditemreturnvalue.java.
    00057  {
    00058       super(factory);
    00059
    00060    }

## Member Function Documentation

String namednodemapsetnameditemreturnvalue::getTargetURI | ( |  | ) | `[inline, virtual]`

| Reimplemented from DOMTest. Definition at line 80 of file namednodemapsetnameditemreturnvalue.java.
    00080                                 {
    00081       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapsetnameditemreturnvalue";
    00082    }

void namednodemapsetnameditemreturnvalue::main | ( | String | args[] | ) | `[inline, static]`

| Definition at line 83 of file namednodemapsetnameditemreturnvalue.java. References DOMTestCase::doMain().
    00083                                           {
    00084         DOMTestCase.doMain(namednodemapsetnameditemreturnvalue.class,args);
    00085    }

void namednodemapsetnameditemreturnvalue::runTest | ( |  | ) | `[inline, virtual]`

| Reimplemented from DOMTestCase. Definition at line 62 of file namednodemapsetnameditemreturnvalue.java. References DOMTestCase::assertEquals(), and DOMTest::load().
    00062                                                     {
    00063       Document doc;
    00064       NodeList elementList;
    00065       Attr newAttribute;
    00066       Node testAddress;
    00067       NamedNodeMap attributes;
    00068       Node newNode;
    00069       String attrValue;
    00070       doc = load("staff");
    00071       elementList = doc.getElementsByTagName("address");
    00072       testAddress = elementList.item(2);
    00073       newAttribute = doc.createAttribute("street");
    00074       attributes = testAddress.getAttributes();
    00075       newNode = attributes.setNamedItem(newAttribute);
    00076       attrValue = newNode.getNodeValue();
    00077       assertEquals("namednodemapSetNamedItemReturnValueAssert","No",attrValue);
    00078
    00079    }

The documentation for this class was generated from the following file:

- namednodemapsetnameditemreturnvalue.java