public function filter($node, $tagname)
    {
        $userDefFunction = $this->_userDefFunction;
        $nodes = $userDefFunction($node, $tagname);

        if (!is_array($nodes)) {
            throw new CssParserException(
                "The user defined combinator is not an array"
            );
        }

        // excludes the items that are not elements
        $items = array();
        foreach ($nodes as $node) {
            if ($node instanceof DOMElement) {
                array_push($items, $node);
            }
        }

        return $items;
    }
public function filter($node, $tagname)
    {
        $userDefFunction = $this->_userDefFunction;
        $nodes = $userDefFunction($node, $tagname);

        if (!is_array($nodes)) {
            throw new CssParserException(
                "The user defined combinator is not an array"
            );
        }

        // excludes the items that are not elements
        $items = array();
        foreach ($nodes as $node) {
            if ($node instanceof DOMElement) {
                array_push($items, $node);
            }
        }

        return $items;
    }
public function filter ( $ node , $ tagname ) { $ userDefFunction = $ this -> _userDefFunction ; $ nodes = $ userDefFunction ( $ node , $ tagname ) ; if ( ! is_array ( $ nodes ) ) { throw new CssParserException ( "The user defined combinator is not an array" ) ; } // excludes the items that are not elements $ items = array ( ) ; foreach ( $ nodes as $ node ) { if ( $ node instanceof DOMElement ) { array_push ( $ items , $ node ) ; } } return $ items ; }
Gets the child nodes.

@param DOMElement $node    DOMElement object
@param string     $tagname Tag name

@return array of DOMElements
Gets the child nodes .