Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.w3c.dom.Element;

public class Main {

    public static void setText(Element ele, String stext) {
        try {
            if (null == ele)
                return;
            if (null == stext) {
                ele.appendChild(ele.getOwnerDocument().createTextNode(""));
            } else {
                ele.getFirstChild().setNodeValue(stext);
            }
        } catch (Exception e) {
            ele.appendChild(ele.getOwnerDocument().createTextNode(stext));
        }
    }
}