public boolean matches(Object node,
ContextSupport contextSupport)
{
//System.err.println( "DefaultNameStep.matches(" + node + ")" );
Navigator nav = contextSupport.getNavigator();
String myPrefix = getPrefix();
String myUri = null;
boolean hasPrefix = ( myPrefix != null ) && (! ( "".equals( myPrefix ) ) );
String nodeUri = null;
String nodeName = null;
if ( nav.isElement( node ) )
{
nodeUri = nav.getElementNamespaceUri( node );
nodeName = nav.getElementName( node );
}
else if ( nav.isAttribute( node ) )
{
nodeUri = nav.getAttributeNamespaceUri( node );
nodeName = nav.getAttributeName( node );
}
else if ( nav.isDocument( node ) )
{
return ( ! hasPrefix ) && matchesAnyName;
}
else if ( nav.isNamespace( node ) )
{
nodeUri = null;
nodeName = nav.getNamespacePrefix( node );
}
else
{
// * will only match elements on most axis
return false;