Searches for elements matching the given xpath and value.
$xpath: The XPath used to find the element.
array $arguments: An array of arguments with keys in the form ':name' matching the placeholders in the query. The values may be either strings or numeric values.
$value: The text content of the matched element to assert.
TRUE if found, otherwise FALSE.
function findContentByXPath($xpath, array $arguments = array(), $value = NULL) {
$elements = $this
->xpath($xpath, $arguments);
$found = TRUE;
if ($value && $elements) {
$found = FALSE;
foreach ($elements as $element) {
if ((string) $element == $value) {
$found = TRUE;
break;
}
}
}
return $elements && $found;
}