note 58819 added to ref.xml

From: Date: Thu, 17 Nov 2005 00:57:58 +0000
Subject: note 58819 added to ref.xml
Groups: php.notes 
Request: Send a blank email to php-notes+get-98680@lists.php.net to get a copy of this message
adrian_popescu at yahoo dot com is right when he states, that Raphael's XMLParser Class (which I began to love!) has a flaw with content of multiple lines. I ran into trouble with entities, because Raphael's class would cut off everything before the last entity plus the entity itself leaving only the rest string. I found out that the "dataHandler" function needs to be repaired. Adrian's mending by use of the ".=" operator is not enough. If $this->data[$index]['content'] isn't set yet you might run into error messages. So check it first! Here's my modification: <?php // You need the complete XML Parser Class by Raphael // as this is only a part of it function dataHandler($parser, $data) { if($data = trim($data)) { $index = count($this->data) -1; if(isset($this->data[$index]['content'])) $this->data[$index]['content'] .= $data; else $this->data[$index]['content'] = $data; } } ?> ---- Manual Page -- http://www.php.net/manual/en/ref.xml.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+58819 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58819&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58819&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58819&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58819&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58819&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58819&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58819&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+58819&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#98680) next »