Main Page Packages Class Hierarchy Compound List File List Compound Members

# elementreplaceattributewithself Class Reference

Inherits DOMTestCase.

List of all members.

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

## Detailed Description

This test calls setAttributeNode to replace an attribute with itself. Since the node is not an attribute of another Element, it would be inappropriate to throw an INUSE_ATTRIBUTE_ERR.

This test was derived from elementinuserattributeerr which inadvertanly made this test.

Author:
  Curt Arnold , Curt Arnold

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

Definition at line 44 of file elementreplaceattributewithself.java.

## Constructor & Destructor Documentation

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

| Definition at line 46 of file elementreplaceattributewithself.java.
    00047  {
    00048       super(factory);
    00049
    00050    }

## Member Function Documentation

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

| Reimplemented from DOMTest. Definition at line 67 of file elementreplaceattributewithself.java.
    00067                                 {
    00068       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementreplaceattributewithself";
    00069    }

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

| Definition at line 70 of file elementreplaceattributewithself.java. References DOMTestCase::doMain().
    00070                                           {
    00071         DOMTestCase.doMain(elementreplaceattributewithself.class,args);
    00072    }

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

| Reimplemented from DOMTestCase. Definition at line 52 of file elementreplaceattributewithself.java. References DOMTestCase::assertSame(), and DOMTest::load().
    00052                                                     {
    00053       Document doc;
    00054       NodeList elementList;
    00055       Element testEmployee;
    00056       Attr streetAttr;
    00057       Attr replacedAttr;
    00058       String value;
    00059       doc = load("staff");
    00060       elementList = doc.getElementsByTagName("address");
    00061       testEmployee = (Element)elementList.item(2);
    00062       streetAttr = testEmployee.getAttributeNode("street");
    00063       replacedAttr = testEmployee.setAttributeNode(streetAttr);
    00064       assertSame("replacedAttr",streetAttr,replacedAttr);
    00065
    00066    }

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

- elementreplaceattributewithself.java