Main Page Packages Class Hierarchy Compound List File List Compound Members

# namednodemapwrongdocumenterr Class Reference

Inherits DOMTestCase.

List of all members.

## Public Methods
| namednodemapwrongdocumenterr (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 WRONG_DOCUMENT_ERR DOMException if "arg" was created from a different document than the one that created the NamedNodeMap.

Create a NamedNodeMap object from the attributes of the last child of the third employee and attempt to add another Attr node to it that was created from a different DOM document. This should raise the desired exception. This method 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#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_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(.,':')='WRONG_DOCUMENT_ERR'])

Definition at line 51 of file namednodemapwrongdocumenterr.java.

## Constructor & Destructor Documentation

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

| Definition at line 53 of file namednodemapwrongdocumenterr.java.
    00054  {
    00055       super(factory);
    00056
    00057    }

## Member Function Documentation

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

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

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

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

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

| Reimplemented from DOMTestCase. Definition at line 59 of file namednodemapwrongdocumenterr.java. References DOMTestCase::assertTrue(), and DOMTest::load().
    00059                                                     {
    00060       Document doc1;
    00061       Document doc2;
    00062       NodeList elementList;
    00063       Node testAddress;
    00064       NamedNodeMap attributes;
    00065       Node newAttribute;
    00066       String name;
    00067       Node setNode;
    00068       doc1 = load("staff");
    00069       doc2 = load("staff");
    00070       elementList = doc1.getElementsByTagName("address");
    00071       testAddress = elementList.item(2);
    00072       newAttribute = doc2.createAttribute("newAttribute");
    00073       attributes = testAddress.getAttributes();
    00074
    00075         {
    00076                 boolean success = false;
    00077                 try {
    00078                         setNode = attributes.setNamedItem(newAttribute);
    00079
    00080                 }
    00081                 catch(DOMException ex) {
    00082                         success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
    00083                 }
    00084                 assertTrue("namednodemapWrongDocumentErrAssert",success);
    00085         }
    00086
    00087    }

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

- namednodemapwrongdocumenterr.java