Java XML Node Value Check isElementNodeOfType(final Node n, final String type)

Here you can find the source of isElementNodeOfType(final Node n, final String type)

Description

is Element Node Of Type

License

Open Source License

Parameter

Parameter Description
n node
type type

Return

whether node is of type

Declaration

public static boolean isElementNodeOfType(final Node n, final String type) 

Method Source Code

//package com.java2s;
/* License as published by the Free Software Foundation; either         */

import org.w3c.dom.Node;

public class Main {
    /**/*from  ww w  .  j  av a2 s.c  om*/
     * @param n node
     * @param type type
     * @return whether node is of type
     */
    public static boolean isElementNodeOfType(final Node n, final String type) {
        return n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equals(type);
    }
}

Related

  1. isCommentAllowed(Node node)
  2. isCommentNode(Node node)
  3. isContainerElement(Node node)
  4. isCreateInstanceSet(Node node)
  5. isElementNodeExist(Node root, String nodeString)
  6. isElementType(Node _node)
  7. isEmpty(Node node)
  8. isEmptyTag(Node p_node)
  9. isEqual(Node a, Node b)