Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

elementgetelementsbytagnameaccessnodelist Class Reference

Inherits DOMTestCase.

List of all members.

Public Methods

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

Static Public Methods

void main (String[] args)


Detailed Description

The "getElementsByTagName(name)" method returns a list of all descendant Elements in the order the children were encountered in a pre order traversal of the element tree.

Create a NodeList of all the descendant elements using the string "employee" as the tagName. The method should return a NodeList whose length is "5" in the order the children were encountered. Access the FOURTH element in the NodeList. The FOURTH element also has children and the first child of this element should be "text".

Author:
NIST , Mary Brady
See also:
http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D

Definition at line 50 of file elementgetelementsbytagnameaccessnodelist.java.


Constructor & Destructor Documentation

elementgetelementsbytagnameaccessnodelist::elementgetelementsbytagnameaccessnodelist DOMTestDocumentBuilderFactory    factory [inline]
 

Definition at line 52 of file elementgetelementsbytagnameaccessnodelist.java.

00053  {
00054       super(factory);
00055 
00056    }


Member Function Documentation

String elementgetelementsbytagnameaccessnodelist::getTargetURI   [inline, virtual]
 

Reimplemented from DOMTest.

Definition at line 83 of file elementgetelementsbytagnameaccessnodelist.java.

00083                                 {
00084       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetelementsbytagnameaccessnodelist";
00085    }

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

Definition at line 86 of file elementgetelementsbytagnameaccessnodelist.java.

References DOMTestCase::doMain().

00086                                           {
00087         DOMTestCase.doMain(elementgetelementsbytagnameaccessnodelist.class,args);
00088    }

void elementgetelementsbytagnameaccessnodelist::runTest   [inline, virtual]
 

Reimplemented from DOMTestCase.

Definition at line 58 of file elementgetelementsbytagnameaccessnodelist.java.

References DOMTestCase::assertEquals(), DOMTest::isIgnoringElementContentWhitespace(), and DOMTest::load().

00058                                                     {
00059       Document doc;
00060       NodeList elementList;
00061       Element testEmployee;
00062       Node firstC;
00063       String childName;
00064       doc = load("staff");
00065       elementList = doc.getElementsByTagName("employee");
00066       testEmployee = (Element)elementList.item(3);
00067       firstC = testEmployee.getFirstChild();
00068       childName = firstC.getNodeName();
00069       
00070         if(
00071         isIgnoringElementContentWhitespace()
00072         ) {
00073         assertEquals("nodename_nowhitespace","employeeId",childName);
00074       
00075         }
00076         
00077                 else {
00078                         assertEquals("nodename_whitespace","#text",childName);
00079       
00080                 }
00081         
00082    }


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