Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.w3c.dom.Attr;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class Main {
    public static void addAttributeToElement(Document doc, Element projectElement, String attributeName,
            String attributeValue) {
        Attr xmlnsAttr = doc.createAttribute(attributeName);
        xmlnsAttr.setValue(attributeValue);
        projectElement.setAttributeNode(xmlnsAttr);
    }
}