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 String getElementBody(Element element) {
        org.w3c.dom.Node valueNode = element.getFirstChild();
        if (valueNode == null) {
            return null;
        }
        if (valueNode.getNodeType() == org.w3c.dom.Node.TEXT_NODE) {
            return valueNode.getNodeValue();
        } else {
            return null;
        }
    }
}