Here you can find the source of getTagNameWithoutPrefix(Node node)
public static String getTagNameWithoutPrefix(Node node)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 Red Hat, Inc.//from ww w.j ava 2 s . c o m * Distributed under license by Red Hat, Inc. All rights reserved. * This program is 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 * * Contributors: * Red Hat, Inc. - initial API and implementation ******************************************************************************/ import org.w3c.dom.Node; public class Main { public static String getTagNameWithoutPrefix(Node node) { if (node == null || node.getNodeName() == null) { return null; } String prefix = node.getPrefix(); String nodeName = node.getNodeName(); String resVal = nodeName; if ((prefix != null && prefix.trim().length() > 0) || nodeName.indexOf(':') != -1) { resVal = nodeName.substring(nodeName.indexOf(':') + 1); } return resVal; } }