You are here

public function QueryPath::writeHTML in QueryPath 6

Same name and namespace in other branches
  1. 7.3 QueryPath/QueryPath.php \QueryPath::writeHTML()
  2. 7.2 QueryPath/QueryPath.php \QueryPath::writeHTML()

File

QueryPath/QueryPath.php, line 1394

Class

QueryPath

Code

public function writeHTML($path = NULL) {
  if ($path == NULL) {
    print $this->document
      ->saveHTML();
  }
  else {
    try {
      set_error_handler(array(
        'QueryPathParseException',
        'initializeFromError',
      ));
      $this->document
        ->saveHTMLFile($path);
    } catch (Exception $e) {
      restore_error_handler();
      throw $e;
    }
    restore_error_handler();
  }
  return $this;
}