Here you can find the source of getChildElementsByTagNameNS(Element parent, String namespaceURI, String localName)
public static List<Element> getChildElementsByTagNameNS(Element parent, String namespaceURI, String localName)
//package com.java2s; //License from project: LGPL import java.util.ArrayList; import java.util.List; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static List<Element> getChildElementsByTagNameNS(Element parent, String namespaceURI, String localName) { List<Element> elems = new ArrayList<Element>(); NodeList nodes = parent.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); if (node.getNodeType() == Node.ELEMENT_NODE && node.getNamespaceURI().equals(namespaceURI) && node.getLocalName().equals(localName)) { elems.add((Element) node); }//from w w w. j a v a 2s .c o m } return elems; } }