Code example for DOMImplementation

Methods: createDocument

0
        String namespaceURI = null;
 
        String qualifiedName = "abc:def";
        doc = (Document) load("staffNS", builder);
        domImpl = doc.getImplementation();
        newDoc = domImpl.createDocument("http://www.w3.org/DOM/Test",
                "dom:doc", docType);
 
        { 
            boolean success = false;
            try { 
                newDoc.createAttributeNS(namespaceURI, qualifiedName);
            } catch (DOMException ex) {
                success = (ex.code == DOMException.NAMESPACE_ERR);
            } 
            assertTrue("documentcreateattributeNS05", success);
        } 
    } 
    public void testCreateAttributeNS6() throws Throwable { 
        Document doc;
        Document newDoc;