documentcreateelementNS02public final class documentcreateelementNS02 extends org.w3c.domts.DOMTestCase The method createElementNS creates an element of the given valid qualifiedName and NamespaceURI.
Invoke the createElementNS method on this Document object with null values for namespaceURI,
and a qualifiedName with an invalid character and check if an INVALID_CHARACTER_ERR is thrown. |
Constructors Summary |
---|
public documentcreateelementNS02(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/documentcreateelementNS02";
| public static void | main(java.lang.String[] args)Runs this test from the command line.
DOMTestCase.doMain(documentcreateelementNS02.class, args);
| public void | runTest()Runs the test case.
Document doc;
Element element;
String namespaceURI = null;
String qualifiedName = "^^";
doc = (Document) load("staffNS", false);
{
boolean success = false;
try {
element = doc.createElementNS(namespaceURI, qualifiedName);
} catch (DOMException ex) {
success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
}
assertTrue("documentcreateelementNS02", success);
}
|
|