Here you can find the source of getElementByQualifiedName(Element n, String namespace, String elementName)
Parameter | Description |
---|---|
n | the node get the children from |
namespace | the namespace of the child element |
elementName | the name of the child elements |
public static Element getElementByQualifiedName(Element n, String namespace, String elementName)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { /**/* ww w . jav a2 s . c o m*/ * Gets the first child Element with a given name * * @param n the node get the children from * @param namespace the namespace of the child element * @param elementName the name of the child elements * @return the first child Element with a given name */ public static Element getElementByQualifiedName(Element n, String namespace, String elementName) { NodeList subNodes = n.getElementsByTagNameNS(namespace, elementName); int sz = subNodes.getLength(); if (sz > 0) { return (Element) subNodes.item(0); } return null; } }