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 {
    /**
     * This is used to create a child node
     * 
     * @param document
     * @param parent
     * @param childName
     * @param childContents
     */
    public static void addChildElement(Document document, Element parent, String childName, String childContents) {
        Element childElement = document.createElement(childName);
        childElement.setTextContent(childContents);
        parent.appendChild(childElement);
    }
}