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.Node;

public class Main {
    /**
     * Create a new element belonging to a namespace with specified text value.
     * 
     * @param document
     * @param nodeName
     * @param textValue
     * @return created element
     */
    public static Element createElementNS(Document document, String namespaceURI, String nodeName,
            String textValue) {
        Element element = document.createElementNS(namespaceURI, nodeName);
        Node textNode = document.createTextNode(textValue);
        element.appendChild(textNode);
        return element;
    }
}