documentcreateattributeNS03public final class documentcreateattributeNS03 extends org.w3c.domts.DOMTestCase The method createAttributeNS raises an INVALID_CHARACTER_ERR if the specified
qualified name contains an illegal character
Invoke the createAttributeNS method on this Document object with a valid value for
namespaceURI, and qualifiedNames that contain illegal characters. Check if the an
INVALID_CHARACTER_ERR was thrown. |
Constructors Summary |
---|
public documentcreateattributeNS03(org.w3c.domts.DOMTestDocumentBuilderFactory factory)Constructor.
super(factory);
//
// check if loaded documents are supported for content type
//
String contentType = getContentType();
preload(contentType, "staffNS", false);
|
Methods Summary |
---|
public java.lang.String | getTargetURI()Gets URI that identifies the test.
return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateattributeNS03";
| public static void | main(java.lang.String[] args)Runs this test from the command line.
DOMTestCase.doMain(documentcreateattributeNS03.class, args);
| public void | runTest()Runs the test case.
Document doc;
Attr attribute;
String namespaceURI = "http://www.w3.org/DOM/Test/Level2";
String qualifiedName;
java.util.List qualifiedNames = new java.util.ArrayList();
qualifiedNames.add("/");
qualifiedNames.add("//");
qualifiedNames.add("\\");
qualifiedNames.add(";");
qualifiedNames.add("&");
qualifiedNames.add("*");
qualifiedNames.add("]]");
qualifiedNames.add(">");
qualifiedNames.add("<");
doc = (Document) load("staffNS", false);
for (int indexN1005A = 0; indexN1005A < qualifiedNames.size(); indexN1005A++) {
qualifiedName = (String) qualifiedNames.get(indexN1005A);
{
boolean success = false;
try {
attribute = doc.createAttributeNS(namespaceURI, qualifiedName);
} catch (DOMException ex) {
success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
}
assertTrue("documentcreateattributeNS03", success);
}
}
|
|