Java XML Has Child hasAnyChildElement(final Element e)

Here you can find the source of hasAnyChildElement(final Element e)

Description

has Any Child Element

License

Open Source License

Declaration

public static boolean hasAnyChildElement(final Element e) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.w3c.dom.Element;

import org.w3c.dom.Node;

public class Main {
    public static boolean hasAnyChildElement(final Element e) {
        for (Node child = e.getFirstChild(); child != null; child = child
                .getNextSibling()) {/*from  ww w  .ja  v  a 2  s  .  c om*/
            if (child instanceof Element) {
                return true;
            }
        }
        return false;
    }
}

Related

  1. getChildHash(Element elem, String elementName, String attrName)
  2. getLastVisibleChildElement(Node parent, Hashtable hiddenNodes)
  3. hasActivityChildNode(Node node)
  4. hasChild(Element element, String child)
  5. hasChild(Element node, String name)
  6. hasChild(Element parent, String nodeName)
  7. hasChild(Element root, String childName)