Main Page Packages Class Hierarchy Compound List File List Compound Members

# attrdefaultvalue Class Reference

Inherits DOMTestCase.

List of all members.

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

## Detailed Description

If there is not an explicit value assigned to an attribute and there is a declaration for this attribute and that declaration includes a default value, then that default value is the attributes default value. Retrieve the attribute named "street" from the last child of of the first employee and examine its value. That value should be the value given the attribute in the DTD file. The test uses the "getNamedItem(name)" method from the NamedNodeMap interface.

Author:
  NIST , Mary Brady

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

Definition at line 49 of file attrdefaultvalue.java.

## Constructor & Destructor Documentation

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

| Definition at line 51 of file attrdefaultvalue.java.
    00052  {
    00053       super(factory);
    00054
    00055    }

## Member Function Documentation

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

| Reimplemented from DOMTest. Definition at line 73 of file attrdefaultvalue.java.
    00073                                 {
    00074       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrdefaultvalue";
    00075    }

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

| Definition at line 76 of file attrdefaultvalue.java. References DOMTestCase::doMain().
    00076                                           {
    00077         DOMTestCase.doMain(attrdefaultvalue.class,args);
    00078    }

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

| Reimplemented from DOMTestCase. Definition at line 57 of file attrdefaultvalue.java. References DOMTestCase::assertEquals(), and DOMTest::load().
    00057                                                     {
    00058       Document doc;
    00059       NodeList addressList;
    00060       Node testNode;
    00061       NamedNodeMap attributes;
    00062       Attr streetAttr;
    00063       String value;
    00064       doc = load("staff");
    00065       addressList = doc.getElementsByTagName("address");
    00066       testNode = addressList.item(0);
    00067       attributes = testNode.getAttributes();
    00068       streetAttr = (Attr)attributes.getNamedItem("street");
    00069       value = streetAttr.getNodeValue();
    00070       assertEquals("attrDefaultValueAssert","Yes",value);
    00071
    00072    }

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

- attrdefaultvalue.java