public function loadXmlFile($path, $parse = false)
    {
        $this->preserveWhiteSpace = false;
        $bool = file_exists($path);

        if (!$bool) {
            $this->error = 'file_not_exists';
            return false;
        }

        $bool = @$this->load($path);
        if (!$bool) {
            $this->error = 'loading_file_error';
            return false;
        }

        if ($parse && !@$this->validate()) {
            $this->error = 'parse_file_error';
            return false;
        }

        return true;
    }
public function loadXmlFile($path, $parse = false)
    {
        $this->preserveWhiteSpace = false;
        $bool = file_exists($path);

        if (!$bool) {
            $this->error = 'file_not_exists';
            return false;
        }

        $bool = @$this->load($path);
        if (!$bool) {
            $this->error = 'loading_file_error';
            return false;
        }

        if ($parse && !@$this->validate()) {
            $this->error = 'parse_file_error';
            return false;
        }

        return true;
    }
public function loadXmlFile ( $ path , $ parse = false ) { $ this -> preserveWhiteSpace = false ; $ bool = file_exists ( $ path ) ; if ( ! $ bool ) { $ this -> error = 'file_not_exists' ; return false ; } $ bool = @ $ this -> load ( $ path ) ; if ( ! $ bool ) { $ this -> error = 'loading_file_error' ; return false ; } if ( $ parse && ! @ $ this -> validate ( ) ) { $ this -> error = 'parse_file_error' ; return false ; } return true ; }
load xml file, optionally check file DTD

@param string $path xml file path
@param boolean $parse if true will check file DTD
@return boolean
@example loadXmlFile('cfg/config.xml', true)
load xml file optionally check file DTD