- if (is_object($alternate))
- foreach($alternate AS $attributes)
- if ($attributes->name == "href")
+ $alternate = $xpath->query("atom:link[@rel='alternate']", $entry)->item(0)->attributes;
+ if (!is_object($alternate)) {
+ $alternate = $xpath->query("atom:link", $entry)->item(0)->attributes;
+ }
+ if (is_object($alternate)) {
+ foreach ($alternate AS $attributes) {
+ if ($attributes->name == "href") {