protected function searchByAttributeRecurrent(
        DOMNodeList $node,
        $value,
        array $list = []
    ) {
        /** @var DomElement $child */
        foreach ($node as $child) {
            if ($child->nodeType === 1) {
                if ($child->hasChildNodes()) {
                    $list = $this->searchByAttributeRecurrent(
                        $child->childNodes,
                        $value,
                        $list
                    );
                }

                $attribute = $child->getAttribute($value);
                if ($attribute) {
                    $list[$attribute] = $child;
                }
            }
        }

        return $list;
    }
protected function searchByAttributeRecurrent(
        DOMNodeList $node,
        $value,
        array $list = []
    ) {
        /** @var DomElement $child */
        foreach ($node as $child) {
            if ($child->nodeType === 1) {
                if ($child->hasChildNodes()) {
                    $list = $this->searchByAttributeRecurrent(
                        $child->childNodes,
                        $value,
                        $list
                    );
                }

                $attribute = $child->getAttribute($value);
                if ($attribute) {
                    $list[$attribute] = $child;
                }
            }
        }

        return $list;
    }
protected function searchByAttributeRecurrent ( DOMNodeList $ node , $ value , array $ list = [ ] ) { /** @var DomElement $child */ foreach ( $ node as $ child ) { if ( $ child -> nodeType === 1 ) { if ( $ child -> hasChildNodes ( ) ) { $ list = $ this -> searchByAttributeRecurrent ( $ child -> childNodes , $ value , $ list ) ; } $ attribute = $ child -> getAttribute ( $ value ) ; if ( $ attribute ) { $ list [ $ attribute ] = $ child ; } } } return $ list ; }
search for all nodes with given attribute
return list of nodes with attribute value as key

@param DOMNodeList $node
@param string $value attribute value to search
@param array|boolean $list list of find nodes for recurrence
@return array
search for all nodes with given attribute return list of nodes with attribute value as key