Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

namednodemapgetnameditem Class Reference

Inherits DOMTestCase.

List of all members.

Public Methods

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

Static Public Methods

void main (String[] args)


Detailed Description

The "getNamedItem(name)" method retrieves a node specified by name.

Retrieve the second employee and create a NamedNodeMap listing of the attributes of the last child. Once the list is created an invocation of the "getNamedItem(name)" method is done with name="domestic". This should result in the domestic Attr node being returned.

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

Definition at line 47 of file namednodemapgetnameditem.java.


Constructor & Destructor Documentation

namednodemapgetnameditem::namednodemapgetnameditem DOMTestDocumentBuilderFactory    factory [inline]
 

Definition at line 49 of file namednodemapgetnameditem.java.

00050  {
00051       super(factory);
00052 
00053    }


Member Function Documentation

String namednodemapgetnameditem::getTargetURI   [inline, virtual]
 

Reimplemented from DOMTest.

Definition at line 71 of file namednodemapgetnameditem.java.

00071                                 {
00072       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapgetnameditem";
00073    }

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

Definition at line 74 of file namednodemapgetnameditem.java.

References DOMTestCase::doMain().

00074                                           {
00075         DOMTestCase.doMain(namednodemapgetnameditem.class,args);
00076    }

void namednodemapgetnameditem::runTest   [inline, virtual]
 

Reimplemented from DOMTestCase.

Definition at line 55 of file namednodemapgetnameditem.java.

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

00055                                                     {
00056       Document doc;
00057       NodeList elementList;
00058       Node testEmployee;
00059       NamedNodeMap attributes;
00060       Attr domesticAttr;
00061       String attrName;
00062       doc = load("staff");
00063       elementList = doc.getElementsByTagName("address");
00064       testEmployee = elementList.item(1);
00065       attributes = testEmployee.getAttributes();
00066       domesticAttr = (Attr)attributes.getNamedItem("domestic");
00067       attrName = domesticAttr.getNodeName();
00068       assertEquals("namednodemapGetNamedItemAssert","domestic",attrName);
00069       
00070    }


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