Here you can find the source of matchingNamespace(Node node, QName requiredNamespace)
private static boolean matchingNamespace(Node node, QName requiredNamespace)
//package com.java2s; //License from project: Apache License import org.w3c.dom.*; import javax.xml.namespace.QName; public class Main { private static boolean matchingNamespace(Node node, QName requiredNamespace) { if (requiredNamespace == null) { return true; } else {/* ww w . j a va 2 s. c o m*/ return requiredNamespace.getNamespaceURI().equals(node.getNamespaceURI()); } } }