Here you can find the source of isCommentAllowed(Node node)
public static boolean isCommentAllowed(Node node)
//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; } }