Here you can find the source of getFirstElement(Node parent)
Parameter | Description |
---|---|
parent | Node |
public static Element getFirstElement(Node parent)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { /**// www . j a va 2s . com * Gets the first element of a Node * @param parent Node * @return first element of a Node */ public static Element getFirstElement(Node parent) { Node n = parent.getFirstChild(); while (n != null && n.getNodeType() != Node.ELEMENT_NODE) { n = n.getNextSibling(); } if (n == null) { return null; } return (Element) n; } }