Here you can find the source of getFirstChildElement(Element element)
Parameter | Description |
---|---|
element | the parent |
public static Element getFirstChildElement(Element element)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { /**/*from ww w . ja v a 2 s . c om*/ * Gets the first child element of an element * * @param element the parent * @return the first child element or null if there isn't one */ public static Element getFirstChildElement(Element element) { Node child = element.getFirstChild(); while (child != null && child.getNodeType() != Node.ELEMENT_NODE) child = child.getNextSibling(); return (Element) child; } }