Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

nodeinsertbeforenewchilddiffdocument Class Reference

Inherits DOMTestCase.

List of all members.

Public Methods

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

Static Public Methods

void main (String[] args)


Detailed Description

The "insertBefore(newChild,refChild)" method raises a WRONG_DOCUMENT_ERR DOMException if the "newChild" was created from a different document than the one that created this node.

Retrieve the second employee and attempt to insert a new child that was created from a different document than the one that created the second employee. An attempt to insert such a child should raise the desired exception.

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

Definition at line 50 of file nodeinsertbeforenewchilddiffdocument.java.


Constructor & Destructor Documentation

nodeinsertbeforenewchilddiffdocument::nodeinsertbeforenewchilddiffdocument DOMTestDocumentBuilderFactory    factory [inline]
 

Definition at line 52 of file nodeinsertbeforenewchilddiffdocument.java.

00053  {
00054       super(factory);
00055 
00056    }


Member Function Documentation

String nodeinsertbeforenewchilddiffdocument::getTargetURI   [inline, virtual]
 

Reimplemented from DOMTest.

Definition at line 86 of file nodeinsertbeforenewchilddiffdocument.java.

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

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

Definition at line 89 of file nodeinsertbeforenewchilddiffdocument.java.

References DOMTestCase::doMain().

00089                                           {
00090         DOMTestCase.doMain(nodeinsertbeforenewchilddiffdocument.class,args);
00091    }

void nodeinsertbeforenewchilddiffdocument::runTest   [inline, virtual]
 

Reimplemented from DOMTestCase.

Definition at line 58 of file nodeinsertbeforenewchilddiffdocument.java.

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

00058                                                     {
00059       Document doc1;
00060       Document doc2;
00061       Node refChild;
00062       Node newChild;
00063       NodeList elementList;
00064       Node elementNode;
00065       Node insertedNode;
00066       doc1 = load("staff");
00067       doc2 = load("staff");
00068       newChild = doc1.createElement("newChild");
00069       elementList = doc2.getElementsByTagName("employee");
00070       elementNode = elementList.item(1);
00071       refChild = elementNode.getFirstChild();
00072       
00073         {
00074                 boolean success = false;
00075                 try {
00076                         insertedNode = elementNode.insertBefore(newChild,refChild);
00077       
00078                 }
00079                 catch(DOMException ex) {
00080                         success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
00081                 }
00082                 assertTrue("throw_WRONG_DOCUMENT_ERR",success);
00083         }
00084 
00085    }


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