Main Page Packages Class Hierarchy Compound List File List Compound Members

# namednodemapinuseattributeerr Class Reference

Inherits DOMTestCase.

List of all members.

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

## Detailed Description

The "setNamedItem(arg)" method raises a INUSE_ATTRIBUTE_ERR DOMException if "arg" is an Attr that is already in an attribute of another Element.

Create a NamedNodeMap object from the attributes of the last child of the third employee and attempt to add an attribute that is already being used by the first employee. This should raise the desired exception.

Author:
  NIST , Mary Brady

See also:
  http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR']) , 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#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])

Definition at line 48 of file namednodemapinuseattributeerr.java.

## Constructor & Destructor Documentation

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

| Definition at line 50 of file namednodemapinuseattributeerr.java.
    00051  {
    00052       super(factory);
    00053
    00054    }

## Member Function Documentation

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

| Reimplemented from DOMTest. Definition at line 88 of file namednodemapinuseattributeerr.java.
    00088                                 {
    00089       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapinuseattributeerr";
    00090    }

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

| Definition at line 91 of file namednodemapinuseattributeerr.java. References DOMTestCase::doMain().
    00091                                           {
    00092         DOMTestCase.doMain(namednodemapinuseattributeerr.class,args);
    00093    }

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

| Reimplemented from DOMTestCase. Definition at line 56 of file namednodemapinuseattributeerr.java. References DOMTestCase::assertTrue(), and DOMTest::load().
    00056                                                     {
    00057       Document doc;
    00058       NodeList elementList;
    00059       Element firstNode;
    00060       Node testNode;
    00061       NamedNodeMap attributes;
    00062       Attr domesticAttr;
    00063       Attr setAttr;
    00064       Node setNode;
    00065       doc = load("staff");
    00066       elementList = doc.getElementsByTagName("address");
    00067       firstNode = (Element)elementList.item(0);
    00068       domesticAttr = doc.createAttribute("domestic");
    00069       domesticAttr.setValue("Yes");
    00070       setAttr = firstNode.setAttributeNode(domesticAttr);
    00071       elementList = doc.getElementsByTagName("address");
    00072       testNode = elementList.item(2);
    00073       attributes = testNode.getAttributes();
    00074
    00075         {
    00076                 boolean success = false;
    00077                 try {
    00078                         setNode = attributes.setNamedItem(domesticAttr);
    00079
    00080                 }
    00081                 catch(DOMException ex) {
    00082                         success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR);
    00083                 }
    00084                 assertTrue("namednodemapInUseAttributeErrAssert",success);
    00085         }
    00086
    00087    }

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

- namednodemapinuseattributeerr.java