if (node.getNodeType() != Node.ELEMENT_NODE) {
return false;
}
NodeNameTest nodeNameTest = (NodeNameTest) test;
QName testName = nodeNameTest.getNodeName();
String namespaceURI = nodeNameTest.getNamespaceURI();
boolean wildcard = nodeNameTest.isWildcard();
String testPrefix = testName.getPrefix();
if (wildcard && testPrefix == null) {
return true;
}
if (wildcard
|| testName.getName()
.equals(DOMNodePointer.getLocalName(node))) {
String nodeNS = DOMNodePointer.getNamespaceURI(node);
return equalStrings(namespaceURI, nodeNS) || nodeNS == null
&& equalStrings(testPrefix, getPrefix(node));
}