/** * @param DOMNode $currentNode * @return bool */ public function canVisit(DOMNode $currentNode) { /** @var DOMElement $currentNode */ if (DomHelper::isElement($currentNode, 'div')) { if (\DomHelper::hasDescendantHeader($currentNode)) { return true; } // this div contains <tabview> tabs if (strpos($currentNode->getAttribute('id'), 'flytab') !== false) { return true; } // this div contains <tabber> tabs if ($currentNode->getAttribute('class') == 'tabber') { return true; } // each tab of <tabber> tabs - wrapped into div with class 'tabbertab' if ($currentNode->getAttribute('class') == 'tabbertab') { return true; } // if any descendant divs contains tabs $xpath = new DOMXPath($currentNode->ownerDocument); $tabDivs = $xpath->query(".//div[contains(@id, 'flytab')]", $currentNode); if ($tabDivs->length > 0) { return true; } return false; } return false; }