Here you can find the source of hasChildElement(NodeList list)
Parameter | Description |
---|---|
list | The NodeList to check. |
public static boolean hasChildElement(NodeList list)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { /**//ww w . j a va 2s. com * Checks if the given {@link NodeList} contains a child element. * * @param list The {@link NodeList} to check. * @return Whether the {@link NodeList} contains children. */ public static boolean hasChildElement(NodeList list) { Node n; for (int i = 0; i < list.getLength(); i++) { n = list.item(i); if (n.getNodeType() == Node.ELEMENT_NODE) { return true; } } return false; } }