Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.w3c.dom.Node;

public class Main {
    /**
     * Gets a node value.
     *
     * @param pNode
     *            the p node
     * @return the node value
     */
    public static String getNodeValue(Node pNode) {
        if (pNode.getNodeValue() != null) {
            return pNode.getNodeValue();
        } else if (pNode.getFirstChild() != null) {
            return getNodeValue(pNode.getFirstChild());
        } else {
            return null;
        }
    }
}