Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
// Released under the terms of the CPL Common Public License version 1.0.

import org.w3c.dom.*;

public class Main {
    public static void addCdataNode(Element element, String tagName, String value) {
        if (value != null && !(value.equals(""))) {
            Document document = element.getOwnerDocument();
            Element titleElement = document.createElement(tagName);
            titleElement.appendChild(document.createCDATASection(value));
            element.appendChild(titleElement);
        }
    }
}