public static boolean hasChildren ( final Element el ) throws SAXException { NodeList children = el . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { Node curnode = children . item ( i ) ; short ntype = curnode . getNodeType ( ) ; if ( ( ntype != Node . TEXT_NODE ) && ( ntype != Node . CDATA_SECTION_NODE ) && ( ntype != Node . COMMENT_NODE ) ) { return true ; } } return false ; }
See if this node has any children