note 36431 deleted from function.xml-parse by didou
| From: | didou@php.net | Date: | Thu, 09 Oct 2003 11:18:50 +0000 |
| Subject: | note 36431 deleted from function.xml-parse by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58113@lists.php.net to get a copy of this message | ||
Note Submitter: Adam Tylmad
----
Hello. It's me again.
Found a notice-bug in my XML-parser. When you have full error-reporting the old version of the code
works but generates a LOT of notice-messages.
Here is the revised version of the code:
function startElement($parser, $tag, $attributeList) {
eval("\$vars = get_object_vars(".$this->path.");");
$this->path .= "->".$tag;
if ($vars and array_key_exists($tag, $vars)) {
eval("\$data = ".$this->path.";");
if (is_array($data)) {
$index = sizeof($data);
$this->path .= "[".$index."]";
} else if (is_object($data)) {
eval($this->path." = array(".$this->path.");");
$this->path .= "[1]";
}
}
eval($this->path." = null;");
foreach($attributeList as $name => $value)
eval($this->path."->".$name. " =
'".XMLParser::cleanString($value)."';");
}