MBool LocationStep::matches(Node* node, Node* context, ContextState* cs) {  if ( !nodeExpr ) return MB_FALSE;  if ( !nodeExpr->matches(node, context, cs) ) return MB_FALSE;  MBool result = MB_TRUE; if ( !isEmpty() ) { NodeSet* nodes = (NodeSet*)evaluate(cs->getParentNode(node),cs); result = nodes->contains(node); delete nodes;
MBool RootExpr::matches(Node* node, Node* context, ContextState* cs) { if ( node ) { return (MBool) (node->getNodeType() == Node::DOCUMENT_NODE);
MBool LocationStep::matches(Node* node, Node* context, ContextState* cs) {    if ( !nodeExpr ) return MB_FALSE;    if ( !nodeExpr->matches(node, context, cs) ) return MB_FALSE;    MBool result = MB_TRUE;    if ( !isEmpty() ) {        NodeSet* nodes = (NodeSet*)evaluate(cs->getParentNode(node),cs);        result = nodes->contains(node);        delete nodes;    }    else if (axisIdentifier == CHILD_AXIS ) {        if (!node->getParentNode())            result = MB_FALSE;    }    return result;} //-- matches