protected function transformAttrToAssoc($node_map)
    {
        // NamedNodeMap is documented very well, so we're using undocumented
        // features, namely, the fact that it implements Iterator and
        // has a ->length attribute
        if ($node_map->length === 0) {
            return array();
        }
        $array = array();
        foreach ($node_map as $attr) {
            $array[$attr->name] = $attr->value;
        }
        return $array;
    }
protected function transformAttrToAssoc($node_map)
    {
        // NamedNodeMap is documented very well, so we're using undocumented
        // features, namely, the fact that it implements Iterator and
        // has a ->length attribute
        if ($node_map->length === 0) {
            return array();
        }
        $array = array();
        foreach ($node_map as $attr) {
            $array[$attr->name] = $attr->value;
        }
        return $array;
    }
protected function transformAttrToAssoc ( $ node_map ) { // NamedNodeMap is documented very well, so we're using undocumented
 // features, namely, the fact that it implements Iterator and
 // has a ->length attribute
 if ( $ node_map -> length === 0 ) { return array ( ) ; } $ array = array ( ) ; foreach ( $ node_map as $ attr ) { $ array [ $ attr -> name ] = $ attr -> value ; } return $ array ; }
Converts a DOMNamedNodeMap of DOMAttr objects into an assoc array.

@param DOMNamedNodeMap $node_map DOMNamedNodeMap of DOMAttr objects.
@return array Associative array of attributes.
Converts a DOMNamedNodeMap of DOMAttr objects into an assoc array .