Here you can find the source of getChild(Element element, String name)
Parameter | Description |
---|---|
element | The parent element |
name | The child element name |
public static Element getChild(Element element, String name)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Element; public class Main { /**// w w w . jav a 2 s. com * Get the first child element with the given name. * * @param element The parent element * @param name The child element name * @return The child element or null */ public static Element getChild(Element element, String name) { return (Element) element.getElementsByTagName(name).item(0); } }