Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

documentcreateelementdefaultattr Class Reference

Inherits DOMTestCase.

List of all members.

Public Methods

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

Static Public Methods

void main (String[] args)


Detailed Description

The "createElement(tagName)" method creates an Element of the type specified. In addition, if there are known attributes with default values, Attr nodes representing them are automatically created and attached to the element. Retrieve the entire DOM document and invoke its "createElement(tagName)" method with tagName="address". The method should create an instance of an Element node whose tagName is "address". The tagName "address" has an attribute with default values, therefore the newly created element will have them.

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

Definition at line 48 of file documentcreateelementdefaultattr.java.


Constructor & Destructor Documentation

documentcreateelementdefaultattr::documentcreateelementdefaultattr DOMTestDocumentBuilderFactory    factory [inline]
 

Definition at line 50 of file documentcreateelementdefaultattr.java.

00051  {
00052       super(factory);
00053 
00054    }


Member Function Documentation

String documentcreateelementdefaultattr::getTargetURI   [inline, virtual]
 

Reimplemented from DOMTest.

Definition at line 74 of file documentcreateelementdefaultattr.java.

00074                                 {
00075       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateelementdefaultattr";
00076    }

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

Definition at line 77 of file documentcreateelementdefaultattr.java.

References DOMTestCase::doMain().

00077                                           {
00078         DOMTestCase.doMain(documentcreateelementdefaultattr.class,args);
00079    }

void documentcreateelementdefaultattr::runTest   [inline, virtual]
 

Reimplemented from DOMTestCase.

Definition at line 56 of file documentcreateelementdefaultattr.java.

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

00056                                                     {
00057       Document doc;
00058       Element newElement;
00059       NamedNodeMap defaultAttr;
00060       Node child;
00061       String name;
00062       String value;
00063       doc = load("staff");
00064       newElement = doc.createElement("address");
00065       defaultAttr = newElement.getAttributes();
00066       child = defaultAttr.item(0);
00067       name = child.getNodeName();
00068       assertEquals("attrName","street",name);
00069       value = child.getNodeValue();
00070       assertEquals("attrValue","Yes",value);
00071       assertSize("attrCount",1,defaultAttr);
00072       
00073    }


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