You are here

protected function QueryPathCssEventHandler::emptyElement in QueryPath 7.2

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

File

QueryPath/CssEventHandler.php, line 867

Class

QueryPathCssEventHandler

Code

protected function emptyElement() {
  $found = new SplObjectStorage();
  $matches = $this
    ->candidateList();
  foreach ($matches as $item) {
    $empty = TRUE;
    foreach ($item->childNodes as $kid) {
      if ($kid->nodeType == XML_ELEMENT_NODE || $kid->nodeType == XML_TEXT_NODE) {
        $empty = FALSE;
        break;
      }
    }
    if ($empty) {
      $found
        ->attach($item);
    }
  }
  $this->matches = $found;
}