You are here

public function QueryPathCssEventHandler::directDescendant in QueryPath 7.2

Same name and namespace in other branches
  1. 6 QueryPath/CssEventHandler.php \QueryPathCssEventHandler::directDescendant()
  2. 7.3 QueryPath/CssEventHandler.php \QueryPathCssEventHandler::directDescendant()

Overrides CssEventHandler::directDescendant

File

QueryPath/CssEventHandler.php, line 991

Class

QueryPathCssEventHandler

Code

public function directDescendant() {
  $this->findAnyElement = FALSE;
  $kids = new SplObjectStorage();
  foreach ($this->matches as $item) {
    $kidsNL = $item->childNodes;
    foreach ($kidsNL as $kidNode) {
      if ($kidNode->nodeType == XML_ELEMENT_NODE) {
        $kids
          ->attach($kidNode);
      }
    }
  }
  $this->matches = $kids;
}