lost+found/src/xpath.js
function _filter (node, expr, resultSet) {
        var
            selectedNodes,
            conditions,
            type,
            idx,
            condition;
        if (expr.and) {
            conditions = expr.and;
            type = 0;
        } else if (expr.or) {
            conditions = expr.or;
            type = 1;
        }
        for (idx = 0; idx < conditions.length; ++idx) {
            condition = conditions[idx];
            if (condition.and || condition.or) {
                selectedNodes = [];
                _filter(node, condition, selectedNodes);
            } else {
                selectedNodes = _select(node, condition);
            }
            if (0 === type && selectedNodes.length === 0) {
                return;
            }
            if (1 === type && selectedNodes.length !== 0) {
                resultSet.push(node);
                return;
            }
        }
        if (0 === type) {
            resultSet.push(node);
        }
    }
function _filter (node, expr, resultSet) {
        var
            selectedNodes,
            conditions,
            type,
            idx,
            condition;
        if (expr.and) {
            conditions = expr.and;
            type = 0;
        } else if (expr.or) {
            conditions = expr.or;
            type = 1;
        }
        for (idx = 0; idx < conditions.length; ++idx) {
            condition = conditions[idx];
            if (condition.and || condition.or) {
                selectedNodes = [];
                _filter(node, condition, selectedNodes);
            } else {
                selectedNodes = _select(node, condition);
            }
            if (0 === type && selectedNodes.length === 0) {
                return;
            }
            if (1 === type && selectedNodes.length !== 0) {
                resultSet.push(node);
                return;
            }
        }
        if (0 === type) {
            resultSet.push(node);
        }
    }
function _filter ( node , expr , resultSet ) { var selectedNodes , conditions , type , idx , condition ; if ( expr . and ) { conditions = expr . and ; type = 0 ; } else if ( expr . or ) { conditions = expr . or ; type = 1 ; } for ( idx = 0 ; idx < conditions . length ; ++ idx ) { condition = conditions [ idx ] ; if ( condition . and || condition . or ) { selectedNodes = [ ] ; _filter ( node , condition , selectedNodes ) ; } else { selectedNodes = _select ( node , condition ) ; } if ( 0 === type && selectedNodes . length === 0 ) { return ; } if ( 1 === type && selectedNodes . length !== 0 ) { resultSet . push ( node ) ; return ; } } if ( 0 === type ) { resultSet . push ( node ) ; } }
Apply the filter expression on the node

@param {gpf.xml.IXmlConstNode} node
@param {Object} expr
@param {gpf.xml.IXmlConstNode[]} resultSet
@private
Apply the filter expression on the node