function parse($file) { $fp = fopen($file, "r"); if (!$fp) { die("Could not open input file"); } while ($data = fread($fp, 4096)) { if (!xml_parse($this->parser, $data, feof($fp))) { DocMerger::XMLErrorHandler($this->parser); } } }
/** * Parses the given file. * * This method should only be called from the prepare method. * * @access private * @param string $file The path to the file to be parsed. * @reutrn void */ function parse($file) { // Try to open the file. $fp = fopen($file, "r"); if (!$fp) { die("Could not open input file"); } // Parse each line of the file. while ($data = fread($fp, 4096)) { if (!xml_parse($this->parser, $data, feof($fp))) { // Handle any errors found. DocMerger::XMLErrorHandler($this->parser); } } }