Main Page Packages Class Hierarchy Compound List File List Compound Members

# processinginstructionsetdatanomodificationallowederrEE Class Reference

Inherits DOMTestCase.

List of all members.

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

## Detailed Description

The "setData(data)" method for a processing instruction causes the DOMException NO_MODIFICATION_ALLOWED_ERR to be raised if the node is readonly.

Create an ent4 entity reference and add to document of the THIRD "gender" element. The elements content is an entity reference. Try to remove the "domestic" attribute from the entity reference by executing the "setData(data)" 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-837822393 , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-837822393')/setraises/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-837822393 , http://www.w3.org/2001/DOM-Test-Suite/level1/core/processinginstructionsetdatanomodificationallowederr.xml

Definition at line 49 of file processinginstructionsetdatanomodificationallowederrEE.java.

## Constructor & Destructor Documentation

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

| Definition at line 51 of file processinginstructionsetdatanomodificationallowederrEE.java.
    00052  {
    00053       super(factory);
    00054
    00055    }

## Member Function Documentation

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

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

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

| Definition at line 89 of file processinginstructionsetdatanomodificationallowederrEE.java. References DOMTestCase::doMain().
    00089                                           {
    00090         DOMTestCase.doMain(processinginstructionsetdatanomodificationallowederrEE.class,args);
    00091    }

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

| Reimplemented from DOMTestCase. Definition at line 57 of file processinginstructionsetdatanomodificationallowederrEE.java. References DOMTestCase::assertTrue(), and DOMTest::load().
    00057                                                     {
    00058       Document doc;
    00059       NodeList genderList;
    00060       Node gender;
    00061       Node entRef;
    00062       ProcessingInstruction piNode;
    00063       String data;
    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       entRef = gender.getFirstChild();
    00071       piNode = (ProcessingInstruction)entRef.getLastChild();
    00072
    00073         {
    00074                 boolean success = false;
    00075                 try {
    00076                         piNode.setData("newData");
    00077
    00078                 }
    00079                 catch(DOMException ex) {
    00080                         success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
    00081                 }
    00082                 assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR",success);
    00083         }
    00084
    00085    }

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

- processinginstructionsetdatanomodificationallowederrEE.java