Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.8

Request #3066 $folding option not working
Submitted: 2004-12-30 19:13 UTC
From: j dot clifton at intuiworx dot com Assigned:
Status: Bogus Package: XML_Parser
PHP Version: 4.3.9 OS: Mac OS X 10.3.7
Roadmaps: (Not assigned)    
Subscription  


 [2004-12-30 19:13 UTC] j dot clifton at intuiworx dot com
Description: ------------ With the current class, it is not possible to set the $folding option because folding is declared as true at runtime, and then the constructor calls xml_parser_set_option(); thus any changes made to $folding are ignored. If the call to xml_parser_set_option() is removed from the constructor and parse() is modified as follows, the problem is eliminated. Reproduce code: --------------- Original: function parse() { if (!is_resource($this->fp)) { return $this->raiseError("no input"); } while ($data = fread($this->fp, 2048)) { $err = $this->parseString($data, feof($this->fp)); if (PEAR::isError($err)) { fclose($this->fp); return $err; } } fclose($this->fp); return true; } Modified: function parse() { if (!is_resource($this->fp)) { return $this->raiseError("no input"); } xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, $this->folding); while ($data = fread($this->fp, 2048)) { $err = $this->parseString($data, feof($this->fp)); if (PEAR::isError($err)) { fclose($this->fp); return $err; } } fclose($this->fp); return true; }

Comments

 [2004-12-31 00:23 UTC] schst
Please upgrade to the latest version of XML_Parser, where this problem already has been fixed.