Here you can find the source of getString(final Node node, final String default_value)
final public static String getString(final Node node, final String default_value)
//package com.java2s; /******************************************************************************* * Copyright (c) 2012 Oak Ridge National Laboratory. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ import org.w3c.dom.Node; public class Main { final public static String getString(final Node node, final String default_value) { if (node != null) { Node text_node = node.getFirstChild(); if (text_node == null) return default_value; return text_node.getNodeValue(); }/*from w w w. j av a2 s . co m*/ return default_value; } }