Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

nodeappendchildinvalidnodetype Class Reference

Inherits DOMTestCase.

List of all members.

Public Methods

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

Static Public Methods

void main (String[] args)


Detailed Description

The "appendChild(newChild)" method raises a HIERARCHY_REQUEST_ERR DOMException if this node is of a type that does not allow children of the type "newChild" to be inserted.

Retrieve the root node and attempt to append a newly created Attr node. An Element node cannot have children of the "Attr" type, therefore the desired exception should be raised.

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

Definition at line 50 of file nodeappendchildinvalidnodetype.java.


Constructor & Destructor Documentation

nodeappendchildinvalidnodetype::nodeappendchildinvalidnodetype DOMTestDocumentBuilderFactory    factory [inline]
 

Definition at line 52 of file nodeappendchildinvalidnodetype.java.

00053  {
00054       super(factory);
00055 
00056    }


Member Function Documentation

String nodeappendchildinvalidnodetype::getTargetURI   [inline, virtual]
 

Reimplemented from DOMTest.

Definition at line 80 of file nodeappendchildinvalidnodetype.java.

00080                                 {
00081       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildinvalidnodetype";
00082    }

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

Definition at line 83 of file nodeappendchildinvalidnodetype.java.

References DOMTestCase::doMain().

00083                                           {
00084         DOMTestCase.doMain(nodeappendchildinvalidnodetype.class,args);
00085    }

void nodeappendchildinvalidnodetype::runTest   [inline, virtual]
 

Reimplemented from DOMTestCase.

Definition at line 58 of file nodeappendchildinvalidnodetype.java.

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

00058                                                     {
00059       Document doc;
00060       Element rootNode;
00061       Node newChild;
00062       Node appendedChild;
00063       doc = load("staff");
00064       rootNode = doc.getDocumentElement();
00065       newChild = doc.createAttribute("newAttribute");
00066       
00067         {
00068                 boolean success = false;
00069                 try {
00070                         appendedChild = rootNode.appendChild(newChild);
00071       
00072                 }
00073                 catch(DOMException ex) {
00074                         success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
00075                 }
00076                 assertTrue("nodeAppendChildInvalidNodeTypeAssert1",success);
00077         }
00078 
00079    }


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