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;
import org.w3c.dom.Text;

public class Main {
    public static Element writeStringElement(Document document, String name, String value, Element parentElement) {
        Element element = document.createElement(name);
        if (value == null) {
            value = "null";
        }
        Text text = document.createTextNode(value);
        element.appendChild(text);
        parentElement.appendChild(element);
        return element;
    }
}