Here you can find the source of getFirstChildElement(Element element)
Parameter | Description |
---|---|
element | a parameter |
public static Element getFirstChildElement(Element element)
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { /**//from ww w.jav a 2 s . c om * Returns the first child element, or null if none exists. * @param element * @return Element */ public static Element getFirstChildElement(Element element) { for (Node node = element.getFirstChild(); node != null; node = node.getNextSibling()) { if (node instanceof Element) { return (Element) node; } } return null; } }