Here you can find the source of getStringValue(Node node)
Parameter | Description |
---|---|
node | a parameter |
private static String getStringValue(Node node)
//package com.java2s; /**/* w ww . j a va 2s. co m*/ * The contents of this file are subject to the license and copyright * detailed in the LICENSE and NOTICE files at the root of the source * tree and available online at * * http://www.dspace.org/license/ */ import org.w3c.dom.Node; public class Main { /** * Return the String value of a Node. * @param node * @return */ private 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; } }