Here you can find the source of isSameNamespaceAndDifferentPrefix(QName qName, Element element)
public static boolean isSameNamespaceAndDifferentPrefix(QName qName, Element element)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.*; import javax.xml.namespace.QName; public class Main { public static boolean isSameNamespaceAndDifferentPrefix(QName qName, Element element) { return element.getNamespaceURI() != null && qName.getNamespaceURI().equals(element.getNamespaceURI()) && (element.getPrefix() == null || !qName.getPrefix().equals(element.getPrefix())); }//from www.j a va 2 s.c o m }