QueryPath\CSS\DOMTraverser::combineAnyDescendant PHP Method

combineAnyDescendant() public method

This checks to see if there are any matching routes from the selector beginning at the present node.
public combineAnyDescendant ( DOMNode $node, array $selectors, integer $index ) : boolean
$node DOMNode A DOM Node.
$selectors array The selectors array.
$index integer The current index to the operative simple selector in the selectors array.
return boolean TRUE if the combination matches, FALSE otherwise.
    public function combineAnyDescendant($node, $selectors, $index)
    {
        while (!empty($node->parentNode)) {
            $node = $node->parentNode;
            // Catch case where element is child of something
            // else. This should really only happen with a
            // document element.
            if ($node->nodeType != XML_ELEMENT_NODE) {
                continue;
            }
            if ($this->matchesSimpleSelector($node, $selectors, $index)) {
                return true;
            }
        }
    }