Here you can find the source of getNamespace(Node node)
public static String getNamespace(Node node)
//package com.java2s; import org.w3c.dom.*; public class Main { /** Gets the namespace of the given node. */ public static String getNamespace(Node node) { String name = node.getNodeName(); int colon = name.lastIndexOf(":"); return colon < 0 ? null : name.substring(0, colon); }/*w w w .j a v a 2s . c o m*/ }