Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import org.w3c.dom.*;

public class Main {
    /**
     * Get the body value of a node
     */
    public static String getNodeBodyValue(Node child) {
        String bodyValue = "";
        NodeList bodies = child.getChildNodes();
        for (int j = 0; j < bodies.getLength(); j++) {
            bodyValue += bodies.item(j).getNodeValue();
        }
        return bodyValue;
    }
}