Here you can find the source of getFirstTextValueFromNodeList(NodeList nList)
Parameter | Description |
---|---|
nList | NodeList |
public static String getFirstTextValueFromNodeList(NodeList nList)
//package com.java2s; //License from project: Apache License import org.w3c.dom.NodeList; public class Main { /**//from w w w . j av a 2s.c o m * Gets the first text value of a NodeList * @param nList NodeList * @return first text value of a NodeList */ public static String getFirstTextValueFromNodeList(NodeList nList) { if (nList != null && nList.getLength() != 0) { return nList.item(0).getTextContent(); } return null; } }