Public Methods | |
| elementinuseattributeerr (DOMTestDocumentBuilderFactory factory) | |
| void | runTest () throws java.lang.Throwable |
| String | getTargetURI () |
Static Public Methods | |
| void | main (String[] args) |
Retrieve the last child of the second employee and append a newly created element. The "createAttribute(name)" and "setAttributeNode(newAttr)" methods are invoked to create and add a new attribute to the newly created Element. The "setAttributeNode(newAttr)" method is once again called to add the new attribute causing an exception to be raised since the attribute is already an attribute of another element.
Definition at line 52 of file elementinuseattributeerr.java.
|
|
Definition at line 54 of file elementinuseattributeerr.java.
00055 {
00056 super(factory);
00057
00058 }
|
|
|
Reimplemented from DOMTest. Definition at line 91 of file elementinuseattributeerr.java.
00091 {
00092 return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementinuseattributeerr";
00093 }
|
|
|
Definition at line 94 of file elementinuseattributeerr.java. References DOMTestCase::doMain().
00094 {
00095 DOMTestCase.doMain(elementinuseattributeerr.class,args);
00096 }
|
|
|
Reimplemented from DOMTestCase. Definition at line 60 of file elementinuseattributeerr.java. References DOMTestCase::assertTrue(), and DOMTest::load().
00060 {
00061 Document doc;
00062 Attr newAttribute;
00063 NodeList addressElementList;
00064 Element testAddress;
00065 Element newElement;
00066 Attr attrAddress;
00067 Node appendedChild;
00068 Attr setAttr1;
00069 Attr setAttr2;
00070 doc = load("staff");
00071 addressElementList = doc.getElementsByTagName("address");
00072 testAddress = (Element)addressElementList.item(1);
00073 newElement = doc.createElement("newElement");
00074 appendedChild = testAddress.appendChild(newElement);
00075 newAttribute = doc.createAttribute("newAttribute");
00076 setAttr1 = newElement.setAttributeNode(newAttribute);
00077
00078 {
00079 boolean success = false;
00080 try {
00081 setAttr2 = testAddress.setAttributeNode(newAttribute);
00082
00083 }
00084 catch(DOMException ex) {
00085 success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR);
00086 }
00087 assertTrue("throw_INUSE_ATTRIBUTE_ERR",success);
00088 }
00089
00090 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001