Java XML NodeList getTextContent(NodeList nodeList)

Here you can find the source of getTextContent(NodeList nodeList)

Description

get Text Content

License

Open Source License

Declaration

static String getTextContent(NodeList nodeList) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class Main {
    static String getTextContent(NodeList nodeList) {
        Node node = getFirstNode(nodeList);
        if (node == null)
            return null;
        return node.getTextContent();
    }//  ww w.j a  v  a  2s . c o  m

    static Node getFirstNode(NodeList nodeList) {
        if (nodeList == null || nodeList.getLength() == 0)
            return null;
        return nodeList.item(0);
    }
}

Related

  1. getNodeValue(NodeList nodes, String tagName)
  2. getNodeValue(String tagName, NodeList nodes)
  3. getOccurs(String nodeName, NodeList nodes)
  4. getTableIDOfTableAlias(String tableAlias, NodeList referList1, NodeList referList2)
  5. getText(NodeList elem)
  6. getTextFields(NodeList list)
  7. getXmlNodeValue(NodeList nodeList)
  8. hasElementNodes(NodeList list)
  9. hasImageNodes(NodeList nodeList)