Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

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

public class Main {
    public static final String TEMPLATE_NODE = "template";
    public static final String NAME_ATTR = "name";

    public static Element addTemplateNode(Document document, Element parent, String name) {
        Element element = document.createElement(TEMPLATE_NODE);
        parent.appendChild(element);
        element.setAttribute(NAME_ATTR, name);
        return element;
    }
}