- foreach($link->attributes AS $attributes) {
- if ($attributes->name == "href")
- $href = $attributes->textContent;
- if ($attributes->name == "rel")
- $rel = $attributes->textContent;
- if ($attributes->name == "type")
- $type = $attributes->textContent;
- if ($attributes->name == "length")
- $length = $attributes->textContent;
- if ($attributes->name == "title")
- $title = $attributes->textContent;
- }
- if (($rel != "") AND ($href != ""))
- switch($rel) {
+ $attribute = self::read_attributes($link);
+
+ if (($attribute['rel'] != "") AND ($attribute['href'] != "")) {
+ switch ($attribute['rel']) {