QueryPath\CSS\DOMTraverser::initialXpathQuery PHP Method

initialXpathQuery() private method

This is optimized for very specific use, and is not a general purpose function.
private initialXpathQuery ( $xpath, $node, $query )
    private function initialXpathQuery($xpath, $node, $query)
    {
        // This works around a bug in which the document element
        // does not correctly search with the $baseQuery.
        if ($node->isSameNode($this->dom->documentElement)) {
            $query = substr($query, 1);
        }
        return $xpath->query($query, $node);
    }