Here you can find the source of getStringValue(Node node)
Parameter | Description |
---|---|
node | a parameter |
public static String getStringValue(Node node)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; public class Main { /**/*from w ww .j av a2 s.c om*/ * Return the String value of a Node. * @param node * @return */ public static String getStringValue(Node node) { String value = node.getNodeValue(); if (node.hasChildNodes()) { Node first = node.getFirstChild(); if (first.getNodeType() == Node.TEXT_NODE) { return first.getNodeValue(); } } return value; } }