Main Page Packages Class Hierarchy Compound List File List Compound Members

# elementremoveattributenomodificationallowederrEE Class Reference

Inherits DOMTestCase.

List of all members.

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

## Detailed Description

The "removeAttribute(name)" method for an attribute causes the DOMException NO_MODIFICATION_ALLOWED_ERR to be raised if the node is readonly.

Create an reference the entity ent4 and add it to the THIRD "gender" element. Try to remove the "domestic" attribute from the entity reference by executing the "removeAttribute(name)" method. This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.

Author:
  Curt Arnold

See also:
  http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9 , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6D6AC0F9')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9 , http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenomodificationallowederr.xml

Definition at line 48 of file elementremoveattributenomodificationallowederrEE.java.

## Constructor & Destructor Documentation

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

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

## Member Function Documentation

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

| Reimplemented from DOMTest. Definition at line 85 of file elementremoveattributenomodificationallowederrEE.java.
    00085                                 {
    00086       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenomodificationallowederrEE";
    00087    }

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

| Definition at line 88 of file elementremoveattributenomodificationallowederrEE.java. References DOMTestCase::doMain().
    00088                                           {
    00089         DOMTestCase.doMain(elementremoveattributenomodificationallowederrEE.class,args);
    00090    }

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

| Reimplemented from DOMTestCase. Definition at line 56 of file elementremoveattributenomodificationallowederrEE.java. References DOMTestCase::assertTrue(), and DOMTest::load().
    00056                                                     {
    00057       Document doc;
    00058       NodeList genderList;
    00059       Node gender;
    00060       EntityReference entRef;
    00061       Element entElement;
    00062       NamedNodeMap attrList;
    00063       Node attrNode;
    00064       Node appendedChild;
    00065       doc = load("staff");
    00066       genderList = doc.getElementsByTagName("gender");
    00067       gender = genderList.item(2);
    00068       entRef = doc.createEntityReference("ent4");
    00069       appendedChild = gender.appendChild(entRef);
    00070       entElement = (Element)entRef.getFirstChild();
    00071
    00072         {
    00073                 boolean success = false;
    00074                 try {
    00075                         entElement.removeAttribute("domestic");
    00076
    00077                 }
    00078                 catch(DOMException ex) {
    00079                         success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
    00080                 }
    00081                 assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR",success);
    00082         }
    00083
    00084    }

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

- elementremoveattributenomodificationallowederrEE.java