Main Page Packages Class Hierarchy Compound List File List Compound Members

# nodelisttraverselist Class Reference

Inherits DOMTestCase.

List of all members.

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

## Detailed Description

The range of valid child node indices is 0 thru length -1

Create a list of all the children elements of the third employee and traverse the list from index=0 thru length -1.

Author:
  NIST , Mary Brady

See also:
  http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337 , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136

Definition at line 44 of file nodelisttraverselist.java.

## Constructor & Destructor Documentation

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

| Definition at line 46 of file nodelisttraverselist.java.
    00047  {
    00048       super(factory);
    00049
    00050    }

## Member Function Documentation

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

| Reimplemented from DOMTest. Definition at line 108 of file nodelisttraverselist.java.
    00108                                 {
    00109       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelisttraverselist";
    00110    }

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

| Definition at line 111 of file nodelisttraverselist.java. References DOMTestCase::doMain().
    00111                                           {
    00112         DOMTestCase.doMain(nodelisttraverselist.class,args);
    00113    }

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

| Reimplemented from DOMTestCase. Definition at line 52 of file nodelisttraverselist.java. References DOMTestCase::assertEquals(), DOMTest::isIgnoringElementContentWhitespace(), and DOMTest::load().
    00052                                                     {
    00053       Document doc;
    00054       NodeList elementList;
    00055       Node employeeNode;
    00056       NodeList employeeList;
    00057       Node child;
    00058       String childName;
    00059       List result = new ArrayList();
    00060
    00061       List expectedWhitespace = new ArrayList();
    00062       expectedWhitespace.add("#text");
    00063       expectedWhitespace.add("employeeId");
    00064       expectedWhitespace.add("#text");
    00065       expectedWhitespace.add("name");
    00066       expectedWhitespace.add("#text");
    00067       expectedWhitespace.add("position");
    00068       expectedWhitespace.add("#text");
    00069       expectedWhitespace.add("salary");
    00070       expectedWhitespace.add("#text");
    00071       expectedWhitespace.add("gender");
    00072       expectedWhitespace.add("#text");
    00073       expectedWhitespace.add("address");
    00074       expectedWhitespace.add("#text");
    00075
    00076       List expectedNoWhitespace = new ArrayList();
    00077       expectedNoWhitespace.add("employeeId");
    00078       expectedNoWhitespace.add("name");
    00079       expectedNoWhitespace.add("position");
    00080       expectedNoWhitespace.add("salary");
    00081       expectedNoWhitespace.add("gender");
    00082       expectedNoWhitespace.add("address");
    00083
    00084       doc = load("staff");
    00085       elementList = doc.getElementsByTagName("employee");
    00086       employeeNode = elementList.item(2);
    00087       employeeList = employeeNode.getChildNodes();
    00088       for(int _index = 0; _index < employeeList.getLength();_index++) {
    00089       child = ( Node ) employeeList.item(_index);
    00090            childName = child.getNodeName();
    00091       result.add(childName);
    00092
    00093         }
    00094
    00095         if(
    00096         isIgnoringElementContentWhitespace()
    00097         ) {
    00098         assertEquals("nowhitespace",expectedNoWhitespace,result);
    00099
    00100         }
    00101
    00102                 else {
    00103                         assertEquals("whitespace",expectedWhitespace,result);
    00104
    00105                 }
    00106
    00107    }

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

- nodelisttraverselist.java