protected function getFistAttributeFromXpath($content, $query, $attribute) { $node = $this->getFirstNodeFromXpath($content, $query); if (!$node) { return false; } $nodeAttr = $node->attributes->getNamedItem($attribute); if (!$nodeAttr) { return false; } return $nodeAttr->nodeValue; }