Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

characterdatareplacedatanomodificationallowederrEE Class Reference

Inherits DOMTestCase.

List of all members.

Public Methods

 characterdatareplacedatanomodificationallowederrEE (DOMTestDocumentBuilderFactory factory) throws DOMTestIncompatibleException
void runTest () throws java.lang.Throwable
String getTargetURI ()

Static Public Methods

void main (String[] args)


Detailed Description

The "replaceData(offset,count,arg)" method raises a NO_MODIFICATION_ALLOWED_ERR DOMException if the node is readonly.

Add an entity reference tp the THIRD "gender" element. Get the FIRST item from the entity reference and execute the "replaceData(offset,count,arg)" 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-E5CBA7FB , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/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-E5CBA7FB , http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedatanomodificationallowederr.xml

Definition at line 47 of file characterdatareplacedatanomodificationallowederrEE.java.


Constructor & Destructor Documentation

characterdatareplacedatanomodificationallowederrEE::characterdatareplacedatanomodificationallowederrEE DOMTestDocumentBuilderFactory    factory [inline]
 

Definition at line 49 of file characterdatareplacedatanomodificationallowederrEE.java.

References DocumentBuilderSetting::notExpandEntityReferences, and DOMTest::setFactory().

00050                                      {
00051 
00052       DocumentBuilderSetting[] settings = new DocumentBuilderSetting[] {
00053 DocumentBuilderSetting.notExpandEntityReferences
00054         };
00055         DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
00056         setFactory(testFactory);
00057 
00058    }


Member Function Documentation

String characterdatareplacedatanomodificationallowederrEE::getTargetURI   [inline, virtual]
 

Reimplemented from DOMTest.

Definition at line 87 of file characterdatareplacedatanomodificationallowederrEE.java.

00087                                 {
00088       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedatanomodificationallowederrEE";
00089    }

void characterdatareplacedatanomodificationallowederrEE::main String    args[] [inline, static]
 

Definition at line 90 of file characterdatareplacedatanomodificationallowederrEE.java.

References DOMTestCase::doMain().

00090                                           {
00091         DOMTestCase.doMain(characterdatareplacedatanomodificationallowederrEE.class,args);
00092    }

void characterdatareplacedatanomodificationallowederrEE::runTest   [inline, virtual]
 

Reimplemented from DOMTestCase.

Definition at line 60 of file characterdatareplacedatanomodificationallowederrEE.java.

References DOMTestCase::assertTrue(), and DOMTest::load().

00060                                                     {
00061       Document doc;
00062       NodeList genderList;
00063       Node genderNode;
00064       CharacterData entText;
00065       EntityReference entReference;
00066       Node appendedNode;
00067       doc = load("staff");
00068       genderList = doc.getElementsByTagName("gender");
00069       genderNode = genderList.item(2);
00070       entReference = doc.createEntityReference("ent3");
00071       appendedNode = genderNode.appendChild(entReference);
00072       entText = (CharacterData)entReference.getFirstChild();
00073       
00074         {
00075                 boolean success = false;
00076                 try {
00077                         entText.replaceData(1,3,"newArg");
00078       
00079                 }
00080                 catch(DOMException ex) {
00081                         success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
00082                 }
00083                 assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR",success);
00084         }
00085 
00086    }


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 19:46:38 2002 for DOM Level 1 Core Test Suite by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001