Java XML Node Value Check isCommentAllowed(Node node)

Here you can find the source of isCommentAllowed(Node node)

Description

is Comment Allowed

License

Open Source License

Declaration

public static boolean isCommentAllowed(Node node) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Crown Copyright (c) 2006, 2007, Copyright (c) 2006, 2007 Jiva Medical.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * //from  w  w w.  j  av a2s.  c  om
 * Contributors:
 *    Jiva Medical - initial API and implementation
 *    B2 International - added generateXMLString(DocumentFragment, boolean)
 *******************************************************************************/

import org.w3c.dom.Node;

public class Main {
    public static boolean isCommentAllowed(Node node) {

        short type = node.getNodeType();
        return type == Node.ELEMENT_NODE || type == Node.TEXT_NODE;
    }
}

Related

  1. isCommentNode(Node node)
  2. isContainerElement(Node node)
  3. isCreateInstanceSet(Node node)
  4. isElementNodeExist(Node root, String nodeString)