/** * Try matching "attributes" filter * * @param Node $item * @param integer $index * @param array $value * @return boolean */ public function filter_by_attributes(Node $item, $index, array $value) { foreach ($value as $attribute_name => $attribute_val) { if ($item->attribute($attribute_name) != $attribute_val) { return FALSE; } } return TRUE; }