Here you can find the source of getFirstChildElement(Element e)
Parameter | Description |
---|---|
e | the element. |
public static Element getFirstChildElement(Element e)
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { /**/*from ww w .j a v a 2s . c o m*/ * Gets the first child element. * * @param e the element. * @return the first child element. */ public static Element getFirstChildElement(Element e) { if (e != null) { NodeList children = e.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node node = children.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { return (Element) node; } } } return null; } }