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; import org.w3c.dom.Element; public class Main { /**// www .j a va 2 s.c om * 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); } }