Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import org.w3c.dom.*;

public class Main {
    public static void setLongContent(Element elem, long value) {
        setTextContent(elem, Long.toString(value));
    }

    public static void setTextContent(Element elem, String content) {
        Document doc = elem.getOwnerDocument();
        if ((content != null) && !content.equals("")) {
            Text textNode = doc.createTextNode(content);
            elem.appendChild(textNode);
        }
    }
}