Here you can find the source of getNodeValue(Node node)
Parameter | Description |
---|---|
node | a parameter |
public static String getNodeValue(Node node)
//package com.java2s; import org.w3c.dom.*; public class Main { /**/*w w w. ja v a 2s .co m*/ * Utility method to fetch the value of the element node * @param node * @return */ public static String getNodeValue(Node node) { for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) { if (child.getNodeType() == Node.TEXT_NODE) { return child.getNodeValue(); } } return null; } }