Пример #1
0
  private static String getTextContent(Node n) {
    NodeList nodeList = n.getChildNodes();
    String textContent = "";
    for (int j = 0; j < nodeList.getLength(); j++) {
      Node k = nodeList.item(j);
      if (k.getNodeType() == Node.TEXT_NODE) {
        textContent = k.getNodeValue();
        break;
      }
    }

    return textContent;
  }