original_string: public function validate($element) {
          $this->last_error = null;
          $celement   = realpath($element);
          $cvalidator = realpath($this->location.DIRECTORY_SEPARATOR.$this->type);
          $result = (empty($celement) || empty($cvalidator));
          if (!$result) {
              $xml_error = new libxml_errors_mgr();
              $doc = new DOMDocument();
              $doc->validateOnParse = false;
              $result = $doc->load($celement, LIBXML_NONET) &&
                        $doc->schemaValidate($cvalidator);
          }
          return $result;
      }
code: public function validate($element) {
          $this->last_error = null;
          $celement   = realpath($element);
          $cvalidator = realpath($this->location.DIRECTORY_SEPARATOR.$this->type);
          $result = (empty($celement) || empty($cvalidator));
          if (!$result) {
              $xml_error = new libxml_errors_mgr();
              $doc = new DOMDocument();
              $doc->validateOnParse = false;
              $result = $doc->load($celement, LIBXML_NONET) &&
                        $doc->schemaValidate($cvalidator);
          }
          return $result;
      }
code_tokens: public function validate ( $ element ) { $ this -> last_error = null ; $ celement = realpath ( $ element ) ; $ cvalidator = realpath ( $ this -> location . DIRECTORY_SEPARATOR . $ this -> type ) ; $ result = ( empty ( $ celement ) || empty ( $ cvalidator ) ) ; if ( ! $ result ) { $ xml_error = new libxml_errors_mgr ( ) ; $ doc = new DOMDocument ( ) ; $ doc -> validateOnParse = false ; $ result = $ doc -> load ( $ celement , LIBXML_NONET ) && $ doc -> schemaValidate ( $ cvalidator ) ; } return $ result ; }
docstring: Validates the item
  @param  string $element - File path for the xml
  @return boolean
docstring_tokens: Validates the item