Code example for Node

Methods: appendChildgetOwnerDocument

0
        Node n=(Node)object2Node.get( oname );
        if( n == null ) {
            log.info( "Node not found " + oname );
            return; 
        } 
        Node attNode=DomUtil.findChildWithAtt(n, "attribute", "name", name);
        if( attNode == null ) {
            // found no existing attribute with this name 
            attNode=n.getOwnerDocument().createElement("attribute");
            DomUtil.setAttribute(attNode, "name", name);
            n.appendChild(attNode);
        }  
        String oldValue=DomUtil.getAttribute(attNode, "value");
        if( oldValue != null ) {
            // we'll convert all values to text content 
            DomUtil.removeAttribute( attNode, "value");
        } 
        DomUtil.setText(attNode, value.toString());
 
        //store(); 
Experience pair programming with AI  Get Codota for Java