protected function initialMatchOnID($selector, $matches)
{
$id = $selector->id;
$found = $this->newMatches();
$baseQuery = ".//*[@id='{$id}']";
$xpath = new \DOMXPath($this->dom);
// Now we try to find any matching IDs.
foreach ($matches as $node) {
if ($node->getAttribute('id') == $id) {
$found->attach($node);
}
$nl = $this->initialXpathQuery($xpath, $node, $baseQuery);
$this->attachNodeList($nl, $found);
}
// Unset the ID selector.
$selector->id = null;
return $found;
}