List of usage examples for org.w3c.dom Node lookupPrefix
public String lookupPrefix(String namespaceURI);
From source file:Main.java
private static String getNodeNameWithNamespace(Node node) { String name = node.getNodeName(); String ns = node.getNamespaceURI(); String prefix = (ns != null) ? node.lookupPrefix(ns) : null; if ((prefix != null) && !name.startsWith(prefix + ":")) { name = prefix + ":" + name; }// www .j a va 2s .c om return name; }