Ejemplo n.º 1
0
  private List<Node> getChildNodes(Node parentNode, String tagName) {
    List<Node> nodeList = new ArrayList<Node>();
    for (Node child = parentNode.getFirstChild(); child != null; child = child.getNextSibling()) {
      if (child.getNodeType() == Node.ELEMENT_NODE && tagName.equals(child.getNodeName())) {
        nodeList.add(child);
      }
    }

    return nodeList;
  }