Code example for Document

Methods: createAttributeNS, createElement

0
//        assertEquals("attrgetownerelement01", "emp:employee", ownerElementName); 
// 
//    } 
    @TestTargetNew( 
        level = TestLevel.PARTIAL, 
        notes = "Doesn't verify that getOwnerElement returns null if an attribute is not in use.", 
        method = "getOwnerElement", 
        args = {} 
    ) 
    public void testGetOwnerElement2() throws Throwable { 
        Document doc;
        Element element;
        Element ownerElement;
        String ownerElementName;
        Attr attr;
 
        doc = (Document) load("staffNS", builder);
        element = doc.createElement("root");
        attr = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att");
        element.setAttributeNodeNS(attr);
        ownerElement = attr.getOwnerElement();