Here you can find the source of getNodeList(Node fatherNode, String nodeName)
Parameter | Description |
---|---|
fatherNode | parent node that containes the node list |
nodeName | name of the nodes in the resulting node list |
public static NodeList getNodeList(Node fatherNode, String nodeName)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { /**//from w ww .jav a2 s.c o m * Gets a node list from document, given the father node and the children node name. * * @param fatherNode parent node that containes the node list * @param nodeName name of the nodes in the resulting node list * @return NodeList containes node of the given name */ public static NodeList getNodeList(Node fatherNode, String nodeName) { NodeList list = null; if (((Element) fatherNode).getElementsByTagName(nodeName) != null) { list = ((Element) fatherNode).getElementsByTagName(nodeName); } return list; } }