Code example for Attr

Methods: setPrefix, setValue

0
        e.setAttribute("xmlns", "urn:test");
        doc.appendChild(e);
        e.setAttribute("att1", "value1");
         
        Attr attr = doc.createAttributeNS("urn:test2","att2");
        attr.setValue("value2");
        attr.setPrefix("p");
         
        e.setAttribute("xmlns:p", "urn:test2");
         
        e.setAttributeNode(attr);
        DOMUtils.writeXml(doc,System.out);
         
        W3CDOMStreamReader reader = new W3CDOMStreamReader(doc.getDocumentElement());
         
        testAttributes(reader);
    } 
     
    public void testElementChild() throws Exception 
    { 
        Document doc = getDocument();