Java XML Node to Element isElementNode(final Node target)

Here you can find the source of isElementNode(final Node target)

Description

Tests to see if target's getNodeType() method returns Node.ELEMENT_NODE.

License

LGPL

Declaration

public static boolean isElementNode(final Node target) 

Method Source Code

//package com.java2s;
/*//w w  w  . j a va  2 s .  co m
 * The contents of this file are subject to the GNU Lesser General Public
 * License Version 2.1 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of
 * the License at http://www.gnu.org/copyleft/lesser.html
 *
 * Software distributed under the License is distributed on an "AS
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * rights and limitations under the License.
 *
 * Developer:
 * Todd Ditchendorf, todd@ditchnet.org
 *
 */

import org.w3c.dom.*;

public class Main {
    /**
     *   Tests to see if <code>target</code>'s <code>getNodeType()</code> 
     *   method returns <code>Node.ELEMENT_NODE</code>.
     *   
     */
    public static boolean isElementNode(final Node target) {
        return Node.ELEMENT_NODE == target.getNodeType();
    }
}

Related

  1. isElement(Node node)
  2. isElement(Node node, String name)
  3. isElementByTag(Node node, String tagName)
  4. isElementContent(Node node)
  5. isElementNamed(Node node, String name)
  6. isElementNode(Node n)
  7. isElementNode(Node n)
  8. isElementNode(Node target)
  9. isElementNode(Node target)